Boost Azure Demo
This commit is contained in:
24
Backend/internal/router/router.go
Normal file
24
Backend/internal/router/router.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Path: Backend/internal/router/router.go
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"boostai-backend/internal/config"
|
||||
"boostai-backend/internal/database"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func Setup(app *fiber.App, cfg *config.Config, db *database.DB) {
|
||||
authMiddleware := buildAuthMiddleware(cfg)
|
||||
|
||||
registerWebRoutes(app, cfg, db, authMiddleware)
|
||||
registerAPIRoutes(app, cfg, db, authMiddleware)
|
||||
|
||||
app.Use(func(c *fiber.Ctx) error {
|
||||
return c.Status(fiber.StatusNotFound).JSON(fiber.Map{
|
||||
"error": "not_found",
|
||||
"message": "The requested endpoint does not exist",
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user