Swagger middleware for Fiber. The middleware handles Swagger UI.
func New(config ...Config) fiber.HandlerImport the middleware package that is part of the Fiber web framework
import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/swagger"
)Then create a Fiber app with app := fiber.New().
After you initiate your Fiber app, you can use the following possibilities:
app.Use(swagger.New(cfg))cfg := swagger.Config{
BasePath: "/", //swagger ui base path
FilePath: "./docs/swagger.json",
}
app.Use(swagger.New(cfg))