22 lines
525 B
Go
22 lines
525 B
Go
|
|
package routes
|
||
|
|
|
||
|
|
import (
|
||
|
|
"elTesto/internal/handlers"
|
||
|
|
"elTesto/internal/middlewares"
|
||
|
|
|
||
|
|
"github.com/gin-gonic/gin"
|
||
|
|
)
|
||
|
|
|
||
|
|
func SetupRoutes(router *gin.Engine) {
|
||
|
|
// Configura el directorio de archivos estáticos
|
||
|
|
router.Static("/static", "./internal/views/static")
|
||
|
|
|
||
|
|
userRoutes := router.Group("/users")
|
||
|
|
{
|
||
|
|
userRoutes.POST("/register", handlers.RegisterUser)
|
||
|
|
userRoutes.POST("/login", handlers.LoginUser)
|
||
|
|
userRoutes.GET("/", middlewares.AuthMiddleware, handlers.GetUsers)
|
||
|
|
userRoutes.GET("/view", handlers.ShowUsers)
|
||
|
|
}
|
||
|
|
}
|