feat: logger, middleware
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func (app *application) routes() *httprouter.Router {
|
||||
func (app *application) routes() http.Handler {
|
||||
router := httprouter.New()
|
||||
|
||||
// Convert the notFoundResponse() helper to a http.Handler using the
|
||||
@@ -24,5 +24,5 @@ func (app *application) routes() *httprouter.Router {
|
||||
router.HandlerFunc(http.MethodPatch, "/v1/movies/:id", app.updateMovieHandler)
|
||||
router.HandlerFunc(http.MethodDelete, "/v1/movies/:id", app.deleteMovieHandler)
|
||||
|
||||
return router
|
||||
return app.recoverPanic(router)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user