This commit is contained in:
lbenedar
2026-03-19 14:06:24 +03:00
parent b8fff8f7d5
commit 6736c24e19
2 changed files with 21 additions and 2 deletions

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()
router.NotFound = http.HandlerFunc(app.notFoundResponse)
@@ -19,5 +19,6 @@ func (app *application) routes() *httprouter.Router {
router.HandlerFunc(http.MethodGet, "/v1/movies/:id", app.showMovieHandler)
router.HandlerFunc(http.MethodPatch, "/v1/movies/:id", app.updateMovieHandler)
router.HandlerFunc(http.MethodDelete, "/v1/movies/:id", app.deleteMovieHandler)
return router
return app.recoverPanic(router)
}