add frame routes

This commit is contained in:
2023-02-01 13:04:46 -03:00
parent fcf6a91257
commit 4af5e9b621
3 changed files with 146 additions and 0 deletions

16
backend/routes/frame.go Normal file
View 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 FrameRoutes(router *httprouter.Router) {
router.GET("/frame", controllers.ListFrame)
router.GET("/frame/:id", controllers.GetFrame)
router.POST("/frame", middlewares.Authenticate(controllers.CreateFrame))
router.PATCH("/frame/:id", middlewares.Authenticate(controllers.UpdateFrame))
router.DELETE("/frame/:id", middlewares.Authenticate(controllers.DeleteFrame))
}

View File

@@ -17,6 +17,7 @@ import (
func Initialize() *httprouter.Router {
router := httprouter.New()
router.GET("/", index)
FrameRoutes(router)
GameRoutes(router)
LevelRoutes(router)
OSRoutes(router)