This commit is contained in:
ctengiz
2024-04-15 10:40:28 +03:00
parent 61f5f8fe04
commit cb91e4dfcf
2 changed files with 63 additions and 15 deletions

View File

@@ -62,6 +62,9 @@ func HttpHandler(re enums.TRunEnv) http.Handler {
// Handle valid / invalid tokens.
r.Use(nauth.CheckTokenValidity)
// sy routes
r.Get("/sy/companies", napi.CompanyList)
// company routes
r.Get("/company/{id:[0-9]+}", companyGet)
r.Get("/company", companyList)
@@ -71,21 +74,6 @@ func HttpHandler(re enums.TRunEnv) http.Handler {
})
})
mux.Route("/sy", func(mr chi.Router) {
// Public Route endpoints
//protected end points
mr.Group(func(r chi.Router) {
// Seek, verify and validate JWT tokens
r.Use(jwtauth.Verifier(svc.S.JWT))
// Handle valid / invalid tokens.
r.Use(nauth.CheckTokenValidity)
r.Get("/companies", napi.CompanyList)
})
})
// Handle Websocket
// mux.HandleFunc("/ws", ws.Handle)