Creating registerUserHandler and registering the endpoint in our routes.go
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 1m34s

This commit is contained in:
Maxime Delporte
2025-11-25 15:54:43 +01:00
parent 2bd0ae90bc
commit 72503a55ff
2 changed files with 71 additions and 1 deletions

View File

@@ -1,8 +1,9 @@
package main
import (
"github.com/julienschmidt/httprouter"
"net/http"
"github.com/julienschmidt/httprouter"
)
func (app *application) routes() http.Handler {
@@ -29,6 +30,8 @@ func (app *application) routes() http.Handler {
router.HandlerFunc(http.MethodPatch, "/v1/movies/:id", app.updateMovieHandler)
router.HandlerFunc(http.MethodDelete, "/v1/movies/:id", app.deleteMovieHandler)
router.HandlerFunc(http.MethodPost, "/v1/users", app.registerUserHandler)
// Return the httprouter instance.
// Wrap the router with the panic recovery middleware
// Wrap the router with the rateLimit() middleware