From 7a1ceb49c3b22bca8005f5fdd63b7d1322d8aaa0 Mon Sep 17 00:00:00 2001 From: Michilis Date: Tue, 5 May 2026 04:25:44 +0000 Subject: [PATCH] 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 --- internal/http/docs/docs.go | 22 ++++++++++++++++++++-- internal/http/docs/swagger-ui-bundle.js | 2 ++ internal/http/docs/swagger-ui.css | 3 +++ internal/http/server.go | 2 ++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 internal/http/docs/swagger-ui-bundle.js create mode 100644 internal/http/docs/swagger-ui.css diff --git a/internal/http/docs/docs.go b/internal/http/docs/docs.go index b33ba7c..d842777 100644 --- a/internal/http/docs/docs.go +++ b/internal/http/docs/docs.go @@ -11,6 +11,12 @@ import ( //go:embed openapi.yaml var openapiYAML []byte +//go:embed swagger-ui-bundle.js +var swaggerUIBundleJS []byte + +//go:embed swagger-ui.css +var swaggerUICSS []byte + var openapiJSON []byte func init() { @@ -70,11 +76,11 @@ const swaggerHTML = ` NIP-05 API - +
- +