Creating recoverPanic method inside our middleware.go file and use it inside routes.go wrapping our router.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 59s
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 59s
This commit is contained in:
@@ -26,5 +26,6 @@ func (app *application) routes() http.Handler {
|
||||
router.HandlerFunc(http.MethodGet, "/v1/movies/:id", app.showMovieHandler)
|
||||
|
||||
// Return the httprouter instance.
|
||||
return router
|
||||
// Wrap the router with the panic recovery middleware
|
||||
return app.recoverPanic(router)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user