Adds handler structs and user handler
This commit is contained in:
parent
832b91a9b5
commit
9fda114cd3
4 changed files with 46 additions and 11 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue