feat: logger, middleware

This commit is contained in:
2026-03-24 22:50:13 +01:00
parent 8e9dc0b581
commit 7d81d1505a
4 changed files with 54 additions and 11 deletions
+2 -2
View File
@@ -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)
}