-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (26 loc) · 696 Bytes
/
main.go
File metadata and controls
33 lines (26 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"github.com/gofiber/fiber/v2"
"github.com/mvrilo/go-redoc"
_ "github.com/mvrilo/go-redoc/_examples/gen/docs"
fiberredoc "github.com/mvrilo/go-redoc/fiber"
)
//go:generate swag init
// @title Fiber Example API
// @version 1.0
// @description Fiber example for openapi spec generation
// @host localhost:8000
// @BasePath /
func main() {
doc := redoc.Redoc{
Title: "Example API",
Description: "Example API Description",
SpecFile: "./docs/swagger.json",
SpecPath: "/swagger.json",
DocsPath: "/docs",
}
r := fiber.New()
r.Use(fiberredoc.New(doc))
println("Documentation served at http://127.0.0.1:8000/docs")
panic(r.Listen(":8000"))
}