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 (:
- Host: GitHub
- URL: https://github.com/jmattheis/go-packr-swagger-ui
- Owner: jmattheis
- License: mit
- Archived: true
- Created: 2018-02-13T18:48:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T18:14:52.000Z (over 7 years ago)
- Last Synced: 2024-11-15T22:55:26.625Z (over 1 year ago)
- Topics: gin-gonic, golang, packr
- Language: Go
- Homepage:
- Size: 12 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()
}
```