go-swagger-ui

module
v0.0.0-...-ff0caf4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2019 License: MIT

README

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

Directories

Path Synopsis
Package statik contains static assets.
Package statik contains static assets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL