Skip to content

oSethoum/fiber-scalar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fiber-scalar

A simple scalar handler for Go Fiber.

Features

  • Serves the swagger docs of your API in scalar fashion

Installation

go get github.com/oSethoum/fiber-scalar

Usage

import scalar "github.com/oSethoum/fiber-scalar"

Example usage with Fiber v3

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")
}

Example usage with Fiber v2

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")
}

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages