An open API service indexing awesome lists of open source software.

https://github.com/jmattheis/go-packr-swagger-ui

go packr swagger-ui dist folder (:
https://github.com/jmattheis/go-packr-swagger-ui

gin-gonic golang packr

Last synced: 10 months ago
JSON representation

go packr swagger-ui dist folder (:

Awesome Lists containing this project

README

          

# Go Packr Swagger UI
This is just a go file containing the dist folder of the [swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui).

## Usage
``` go
package main

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

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

## Usage with [gin-gonic/gin](https://github.com/gin-gonic/gin)
``` go
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()
}
```