mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: log unmatched requests
This commit is contained in:
parent
312dfb36d8
commit
c3957ec0c8
8
main.go
8
main.go
@ -189,6 +189,14 @@ func main() {
|
||||
rootRouter := router.PathPrefix("/").Subrouter()
|
||||
apiRouter := router.PathPrefix("/api").Subrouter().StrictSlash(true)
|
||||
|
||||
// https://github.com/gorilla/mux/issues/416
|
||||
router.NotFoundHandler = router.NewRoute().BuildOnly().HandlerFunc(http.NotFound).GetHandler()
|
||||
router.NotFoundHandler = middlewares.NewLoggingMiddleware(logbuch.Info, []string{
|
||||
"/assets",
|
||||
"/favicon",
|
||||
"/service-worker.js",
|
||||
})(router.NotFoundHandler)
|
||||
|
||||
// Globally used middlewares
|
||||
router.Use(middlewares.NewPrincipalMiddleware())
|
||||
router.Use(middlewares.NewLoggingMiddleware(logbuch.Info, []string{"/assets"}))
|
||||
|
Loading…
Reference in New Issue
Block a user