mirror of
https://forgejo.merr.is/annika/isl-api.git
synced 2025-12-14 11:51:01 -05:00
Switched From httprouter to chi
I believe all functionality works properly
This commit is contained in:
parent
c1231d487a
commit
d4b2d5fefb
9 changed files with 77 additions and 78 deletions
19
Routes/PowerItemRoutes.go
Normal file
19
Routes/PowerItemRoutes.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package routes
|
||||
|
||||
import (
|
||||
"forgejo.merr.is/annika/isl-api/Controllers"
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
func SetupPowerItemRoutes(c Controllers.PowerItemController) *chi.Mux {
|
||||
r := chi.NewRouter()
|
||||
|
||||
r.Get("/", c.GetAll)
|
||||
r.Get("/asMap", c.GetAllAsMap)
|
||||
r.Get("/byType/{type:[1-3]}", c.GetAllByType)
|
||||
r.Get("/byType/{type:[1-3]}/asMap", c.GetAllByTypeAsMap)
|
||||
r.Post("/", c.Add)
|
||||
r.Post("/multiple", c.AddMultiple)
|
||||
|
||||
return r
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue