Added swager docs
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
package fiberconfig
|
||||
|
||||
import (
|
||||
"github.com/Flussen/swagger-fiber-v3"
|
||||
"github.com/gofiber/fiber/v3"
|
||||
"github.com/gofiber/fiber/v3/middleware/logger"
|
||||
"github.com/gofiber/fiber/v3/middleware/static"
|
||||
)
|
||||
|
||||
func Setup(app *fiber.App) {
|
||||
app.Get("/api/docs.json", static.New("./docs/swagger.json"))
|
||||
|
||||
app.Get("/api/swagger/*", swagger.New(swagger.Config{
|
||||
URL: "/api/docs.json",
|
||||
Title: "mcheads.net API Documentation",
|
||||
}))
|
||||
|
||||
app.Use("/api", func(c fiber.Ctx) error {
|
||||
c.Set("Content-Type", "application/json")
|
||||
return c.Next()
|
||||
|
||||
Reference in New Issue
Block a user