A simple scalar handler for Go Fiber.
- Serves the swagger docs of your API in scalar fashion
go get github.com/oSethoum/fiber-scalarimport scalar "github.com/oSethoum/fiber-scalar"package main
import (
"github.com/gofiber/fiber/v3"
scalar "github.com/oSethoum/fiber-scalar"
)
func main() {
app := fiber.New()
app.Get("/docs", scalar.Handler(&scalar.Options{
SpecFile: "./docs/swagger.json",
Layout: scalar.LayoutClassic,
Theme: scalar.ThemeSolarized,
DarkMode: true,
// other options can go here
}))
app.Listen(":5000")
}package main
import (
"github.com/gofiber/fiber/v2"
scalar "github.com/oSethoum/fiber-scalar"
)
func main() {
app := fiber.New()
app.Get("/docs", scalar.FiberHandler(&scalar.Options{
SpecFile: "./docs/swagger.json",
Layout: scalar.LayoutClassic,
Theme: scalar.ThemeSolarized,
DarkMode: true,
// other options can go here
}))
app.Listen(":5000")
}MIT