I am batman
This commit is contained in:
30
api-gateway/internal/routes/routes.go
Normal file
30
api-gateway/internal/routes/routes.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"go-microservices/api-gateway/internal/clients"
|
||||
"go-microservices/api-gateway/internal/handlers"
|
||||
"go-microservices/api-gateway/internal/middlewares"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func RegisterAuthRoutes(app *fiber.App, authHandler *handlers.AuthHandler, authClient *clients.AuthClient) {
|
||||
api := app.Group("/api/v1")
|
||||
|
||||
// Health route
|
||||
api.Get("/", func(c *fiber.Ctx) error {
|
||||
return c.SendString("API Gateway is running!")
|
||||
})
|
||||
|
||||
api.Post("/signup", authHandler.SignUp)
|
||||
api.Post("/signin", authHandler.SignIn)
|
||||
api.Post("/validate", authHandler.ValidateToken)
|
||||
api.Post("/userinfo", middlewares.JWTMiddleware(authClient), authHandler.GetUserInfo)
|
||||
|
||||
// Test endpoints
|
||||
api.Post("/test", authHandler.CreateTest)
|
||||
api.Get("/tests", authHandler.ListTests)
|
||||
api.Get("/tests/:id", authHandler.GetTest)
|
||||
api.Put("/tests/:id", authHandler.UpdateTest)
|
||||
api.Delete("/tests/:id", authHandler.DeleteTest)
|
||||
}
|
||||
Reference in New Issue
Block a user