Fix(API): cors middleware hoisting because it doesn't work with r.Group
This commit is contained in:
parent
8f60d61ff9
commit
e0c8aed5c7
@ -52,9 +52,10 @@ func Start(addr string, secret string) {
|
||||
MaxAge: 300,
|
||||
})
|
||||
|
||||
r.Use(cors.Handler)
|
||||
r.Get("/", hello)
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(cors.Handler, authentication)
|
||||
r.Use(authentication)
|
||||
|
||||
r.Get("/logs", getLogs)
|
||||
r.Get("/traffic", traffic)
|
||||
|
Reference in New Issue
Block a user