go-swagger-ui
Compile Swagger UI 3.23.5 into your application
Install or update
$ go get -u github.com/gig/go-swagger-ui/statik
Usage
_ "github.com/GiG/go-swagger-ui/statik"
// ...
statikFS, err := fs.New()
if err != nil {
return err
}
staticServer := http.FileServer(statikFS)
Static server is a HTTP handle, so you can serve it easily using Mux or net/http
sh := http.StripPrefix("/swaggerui/", staticServer)
router.PathPrefix("/swaggerui/").Handler(sh)
It searches your swagger documentation in ./swagger.yaml
so you need to manually serve taht file as well.
License
MIT