mirror of
https://gitee.com/shikong-sk/gofiber-study
synced 2025-02-23 23:32:15 +08:00
21 lines
489 B
Go
21 lines
489 B
Go
package app
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v2"
|
|
"gofiber.study.skcks.cn/common/response"
|
|
)
|
|
|
|
// routes
|
|
// @Summary 获取所有路由
|
|
// @Description 获取所有路由信息
|
|
// @Tags Routes
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Success 200 {object} response.Response{data=[][]fiber.Route}
|
|
// @Router /routes [get]
|
|
func routes(app *fiber.App) {
|
|
app.Get("/routes", func(ctx *fiber.Ctx) error {
|
|
return ctx.JSON(response.NewResponse(app.Stack()))
|
|
})
|
|
}
|