mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-28 01:48:51 +05:00
Bug fix
This commit is contained in:
@@ -37,11 +37,11 @@ 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) {
|
||||||
_ = determineBaseURL(r)
|
baseURL := determineBaseURL(r)
|
||||||
|
|
||||||
// Use relative SpecURL so the browser automatically uses the current origin and protocol
|
// Use absolute SpecURL so the library does not try to read a local file path
|
||||||
htmlContent, err := scalar.ApiReferenceHTML(&scalar.Options{
|
htmlContent, err := scalar.ApiReferenceHTML(&scalar.Options{
|
||||||
SpecURL: "/openapi.json",
|
SpecURL: fmt.Sprintf("%s/openapi.json", baseURL),
|
||||||
CustomOptions: scalar.CustomOptions{
|
CustomOptions: scalar.CustomOptions{
|
||||||
PageTitle: "Neo Movies API Documentation",
|
PageTitle: "Neo Movies API Documentation",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user