Switched From httprouter to chi

I believe all functionality works properly
This commit is contained in:
Annika Merris 2024-02-07 19:15:25 -05:00
parent c1231d487a
commit d4b2d5fefb
9 changed files with 77 additions and 78 deletions

19
Routes/PowerItemRoutes.go Normal file
View 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
}