Adds handler structs and user handler

This commit is contained in:
Dennis Schoepf 2024-04-28 20:05:36 +02:00
parent 832b91a9b5
commit 9fda114cd3
4 changed files with 46 additions and 11 deletions

View file

@ -24,9 +24,10 @@ func Setup(app *fiber.App, db *sql.DB) error {
Validator: apiKeyValidator(apiKey),
}))
v1 := api.Group("/v1")
apiHandler := NewHandler(db)
v1.Get("/users", FetchAllUsersHandler)
v1 := api.Group("/v1")
v1.Post("/users", apiHandler.createUser)
return nil
}