This commit is contained in:
lbenedar
2026-03-10 14:31:03 +03:00
commit 10748c612b
8 changed files with 122 additions and 0 deletions

17
cmd/api/routes.go Normal file
View File

@@ -0,0 +1,17 @@
package main
import (
"net/http"
"github.com/julienschmidt/httprouter"
)
func (app *application) routes() *httprouter.Router {
router := httprouter.New()
router.HandlerFunc(http.MethodGet, "/v1/healtcheck", app.healthcheckHandler)
router.HandlerFunc(http.MethodPost, "/v1/movies", app.createMovieHandler)
router.HandlerFunc(http.MethodGet, "/v1/movies/:id", app.showMovieHandler)
return router
}