Serve Swagger UI from embedded assets instead of unpkg CDN
Bundle swagger-ui-dist@5.32.5 (bundle + CSS) with go:embed and expose /docs/swagger-ui-bundle.js and /docs/swagger-ui.css so /docs works without external script loads (fixes timeouts when unpkg is unreachable). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -62,6 +62,8 @@ func NewServer(d Deps) *http.Server {
|
||||
r.Get("/openapi.json", docs.ServeJSON)
|
||||
r.Get("/docs", docs.ServeUI)
|
||||
r.Get("/docs/", docs.ServeUI)
|
||||
r.Get("/docs/swagger-ui-bundle.js", docs.ServeJS)
|
||||
r.Get("/docs/swagger-ui.css", docs.ServeCSS)
|
||||
|
||||
r.Route("/v1", func(r chi.Router) {
|
||||
r.Get("/pricing", pricing.Handle)
|
||||
|
||||
Reference in New Issue
Block a user