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

jmattheis/go-packr-swagger-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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