change function name

This commit is contained in:
grumbulon 2023-06-10 14:32:58 -04:00
parent cffe76f2b2
commit 2e7f2ae1a1
2 changed files with 4 additions and 4 deletions

View file

@ -33,7 +33,7 @@ func API() http.Handler {
api.Use(jwtauth.Verifier(tokenAuth))
api.Use(jwtauth.Authenticator)
api.With(setDBMiddleware).With(pommeLogger).Post("/upload", ReceiveFile)
api.With(setDBMiddleware).With(setLoggerMiddleware).Post("/upload", ReceiveFile)
})
// Open routes
@ -51,8 +51,8 @@ func API() http.Handler {
render.JSON(w, r, resp)
}),
))
api.With(setDBMiddleware).With(pommeLogger).Post("/create", NewUser)
api.With(setDBMiddleware).With(pommeLogger).Post("/login", Login)
api.With(setDBMiddleware).With(setLoggerMiddleware).Post("/create", NewUser)
api.With(setDBMiddleware).With(setLoggerMiddleware).Post("/login", Login)
api.Post("/logout", Logout)
})

View file

@ -51,7 +51,7 @@ func setDBMiddleware(next http.Handler) http.Handler {
})
}
func pommeLogger(next http.Handler) http.Handler {
func setLoggerMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
logger := newResponder()
ctx := context.WithValue(r.Context(), keyLoggerContextID, logger)