add level routes
This commit is contained in:
16
backend/routes/level.go
Normal file
16
backend/routes/level.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"git.cromer.cl/Proyecto-Titulo/alai-server/backend/controllers"
|
||||
"git.cromer.cl/Proyecto-Titulo/alai-server/backend/middlewares"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func LevelRoutes(router *httprouter.Router) {
|
||||
router.GET("/level", controllers.ListLevel)
|
||||
router.GET("/level/:id", controllers.GetLevel)
|
||||
router.POST("/level", middlewares.Authenticate(controllers.CreateLevel))
|
||||
router.PATCH("/level/:id", middlewares.Authenticate(controllers.UpdateLevel))
|
||||
router.DELETE("/level/:id", middlewares.Authenticate(controllers.DeleteLevel))
|
||||
}
|
@@ -18,6 +18,7 @@ func Initialize() *httprouter.Router {
|
||||
router := httprouter.New()
|
||||
router.GET("/", index)
|
||||
GameRoutes(router)
|
||||
LevelRoutes(router)
|
||||
OSRoutes(router)
|
||||
PlayerRoutes(router)
|
||||
UserRoutes(router)
|
||||
|
Reference in New Issue
Block a user