Creating listMoviesHandler and adding /v1/movies GET endpoint to use it.

This commit is contained in:
Maxime Delporte
2025-11-11 10:43:34 +01:00
parent b77d3adb55
commit 041d302a79
2 changed files with 39 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ func (app *application) routes() http.Handler {
respectively.
*/
router.HandlerFunc(http.MethodGet, "/v1/healthcheck", app.healthcheckHandler)
router.HandlerFunc(http.MethodGet, "/v1/movies", app.listMoviesHandler)
router.HandlerFunc(http.MethodPost, "/v1/movies", app.createMovieHandler)
router.HandlerFunc(http.MethodGet, "/v1/movies/:id", app.showMovieHandler)
router.HandlerFunc(http.MethodPatch, "/v1/movies/:id", app.updateMovieHandler)