net/http
& gorilla/mux
middleware to serve Swagger Ui files and doc.json file which generated from Swagno
- Get Swagno
- Create your endpoint array. See: https://github.com/go-swagno/swagno/blob/master/README.md#getting-started
- Get swagno-http
go get github.com/go-swagno/swagno-http
- Import swagno-http to your handler
import "github.com/go-swagno/swagno-http/swagger"
- Be sure you created swagger instance and endpoints
- Create swagger handler
// net-http
m.Handle("/swagger/", swagger.SwaggerHandler(sw.GenerateDocs()))
// gorilla/mux
r.PathPrefix("/swagger").Handler(swagger.SwaggerHandler(sw.GenerateDocs()))
- Visit /swagger and /swagger/doc.json for confirmation