Added swagger support
This commit is contained in:
@ -3,7 +3,7 @@ package api
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/helmet"
|
||||
"{{cookiecutter.module_path}}/internal/app/api/v1"
|
||||
v1 "{{cookiecutter.module_path}}/internal/app/api/v1"
|
||||
)
|
||||
|
||||
func ConfigureRoutes(app *fiber.App) error {
|
||||
|
@ -5,14 +5,21 @@ import (
|
||||
"github.com/gofiber/fiber/v2/middleware/requestid"
|
||||
)
|
||||
|
||||
// @Summary Endpoint for testing latency
|
||||
// @Description Endpoint for testing latency
|
||||
// @Tags Health
|
||||
// @Success 200 {string} string
|
||||
// @Router /api/v1/ping [get]
|
||||
func Ping(c *fiber.Ctx) error {
|
||||
return c.SendString("pong")
|
||||
}
|
||||
|
||||
func ConfigureRoutes(router fiber.Router) error {
|
||||
v1 := router.Group("/v1")
|
||||
|
||||
v1.Use(requestid.New())
|
||||
|
||||
v1.Get("/ping", func(c *fiber.Ctx) error {
|
||||
return c.SendString("pong")
|
||||
})
|
||||
v1.Get("/ping", Ping)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user