alai-server/backend/routes/user.go

20 lines
735 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)
2023-01-27 23:51:05 -03:00
router.GET("/auth", middlewares.Authenticate(controllers.AuthenticateUser))
2022-06-29 21:26:05 -04:00
router.GET("/users", middlewares.Authenticate(controllers.ListUsers))
router.GET("/user/:id", middlewares.Authenticate(controllers.GetUser))
2023-01-27 23:51:05 -03:00
router.POST("/user", middlewares.Authenticate(controllers.CreateUser))
2022-06-29 21:26:05 -04:00
router.PATCH("/user/:id", middlewares.Authenticate(controllers.UpdateUser))
2023-01-27 23:51:05 -03:00
router.DELETE("/user/:id", middlewares.Authenticate(controllers.DeleteUser))
2022-06-29 21:26:05 -04:00
}