mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
16 lines
449 B
Go
16 lines
449 B
Go
package api
|
|
|
|
import (
|
|
"github.com/glueops/autoglue/docs"
|
|
"github.com/go-chi/chi/v5"
|
|
httpSwagger "github.com/swaggo/http-swagger/v2"
|
|
)
|
|
|
|
func mountSwaggerRoutes(r chi.Router) {
|
|
r.Get("/swagger/*", httpSwagger.Handler(
|
|
httpSwagger.URL("swagger.json"),
|
|
))
|
|
r.Get("/swagger/swagger.json", serveSwaggerFromEmbed(docs.SwaggerJSON, "application/json"))
|
|
r.Get("/swagger/swagger.yaml", serveSwaggerFromEmbed(docs.SwaggerYAML, "application/x-yaml"))
|
|
}
|