mirror of
https://git.freecumextremist.com/grumbulon/pomme.git
synced 2024-12-22 10:40:43 +00:00
change function name
This commit is contained in:
parent
cffe76f2b2
commit
2e7f2ae1a1
2 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
})
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue