2016-10-25 15:20:06 +00:00
package server
2018-10-15 14:39:01 +00:00
//go:generate env GO111MODULE=on go run github.com/kevinburke/go-bindata/go-bindata -o swagger_gen.go -tags assets -ignore go -nocompress -pkg server .
2016-10-25 15:20:06 +00:00
import "net/http"
2016-10-28 16:27:06 +00:00
// Spec servers the swagger.json file from bindata
2016-10-25 15:20:06 +00:00
func Spec ( ) http . HandlerFunc {
swagger , err := Asset ( "swagger.json" )
return http . HandlerFunc ( func ( w http . ResponseWriter , r * http . Request ) {
if err != nil {
http . Error ( w , err . Error ( ) , http . StatusInternalServerError )
return
}
w . Header ( ) . Set ( "Content-Type" , "application/json" )
w . WriteHeader ( http . StatusOK )
2016-12-20 20:59:56 +00:00
_ , _ = w . Write ( swagger )
2016-10-25 15:20:06 +00:00
} )
}