alai-server/backend/routes/user.go

18 lines
656 B
Go
Raw Normal View History

2022-06-29 21:26:05 -04:00
package routes
import (
2022-07-22 23:00:31 -04:00
"git.cromer.cl/Proyecto-Titulo/alai-server/backend/controllers"
"git.cromer.cl/Proyecto-Titulo/alai-server/backend/middlewares"
2022-06-29 21:26:05 -04:00
"github.com/julienschmidt/httprouter"
)
func UserRoutes(router *httprouter.Router) {
router.POST("/login", controllers.Login)
router.GET("/users", middlewares.Authenticate(controllers.ListUsers))
router.POST("/user", middlewares.Authenticate(controllers.CreateUser))
router.GET("/user/:id", middlewares.Authenticate(controllers.GetUser))
router.PATCH("/user/:id", middlewares.Authenticate(controllers.UpdateUser))
router.GET("/auth", middlewares.Authenticate(controllers.AuthenticateUser))
}