Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (25 loc) · 654 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 654 Bytes

Go Packr Swagger UI

This is just a go file containing the dist folder of the swagger-api/swagger-ui.

Usage

package main

import "github.com/jmattheis/go-packr-swagger-ui"

func main() {
   box := swaggerui.GetBox()
}

Usage with gin-gonic/gin

package main

import (
    "github.com/jmattheis/go-packr-swagger-ui"
    "net/http"
)

func main() {
   box := swaggerui.GetBox()
   router := gin.New()
   g.GET("/docs/*any", gin.WrapH(http.StripPrefix("/docs/", http.FileServer(box))))
   g.GET("/swagger", yourSwaggerDefinition)
   router.Run()
}