This commit is contained in:
15
internal/routes/authRoute.go
Normal file
15
internal/routes/authRoute.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"history-api/internal/controllers"
|
||||
"history-api/internal/middlewares"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func AuthRoutes(app *fiber.App, controller *controllers.AuthController) {
|
||||
route := app.Group("/auth")
|
||||
route.Post("/signin", controller.Signin)
|
||||
route.Post("/signup", controller.Signup)
|
||||
route.Post("/refresh", middlewares.JwtRefresh(), controller.RefreshToken)
|
||||
}
|
||||
18
internal/routes/notFoundRoute.go
Normal file
18
internal/routes/notFoundRoute.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"history-api/internal/dtos/response"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func NotFoundRoute(app *fiber.App) {
|
||||
app.Use(
|
||||
func(c fiber.Ctx) error {
|
||||
return c.Status(fiber.StatusNotFound).JSON(response.CommonResponse{
|
||||
Status: false,
|
||||
Message: "sorry, endpoint is not found",
|
||||
})
|
||||
},
|
||||
)
|
||||
}
|
||||
13
internal/routes/tileRoute.go
Normal file
13
internal/routes/tileRoute.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"history-api/internal/controllers"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func TileRoutes(app *fiber.App, controller *controllers.TileController) {
|
||||
route := app.Group("/tiles")
|
||||
route.Get("/metadata", controller.GetMetadata)
|
||||
route.Get("/:z/:x/:y", controller.GetTile)
|
||||
}
|
||||
Reference in New Issue
Block a user