mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-27 17:38:51 +05:00
fix: Use relative URL for OpenAPI spec to bypass Cloudflare
- Change SpecURL from absolute to relative path - Fixes documentation loading on api.neomovies.ru - Browser will request openapi.json from same domain
This commit is contained in:
@@ -37,10 +37,8 @@ func (h *DocsHandler) GetOpenAPISpec(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *DocsHandler) ServeDocs(w http.ResponseWriter, r *http.Request) {
|
func (h *DocsHandler) ServeDocs(w http.ResponseWriter, r *http.Request) {
|
||||||
baseURL := determineBaseURL(r)
|
|
||||||
|
|
||||||
htmlContent, err := scalar.ApiReferenceHTML(&scalar.Options{
|
htmlContent, err := scalar.ApiReferenceHTML(&scalar.Options{
|
||||||
SpecURL: fmt.Sprintf("%s/openapi.json", baseURL),
|
SpecURL: "/openapi.json",
|
||||||
CustomOptions: scalar.CustomOptions{
|
CustomOptions: scalar.CustomOptions{
|
||||||
PageTitle: "Neo Movies API Documentation",
|
PageTitle: "Neo Movies API Documentation",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user