diff --git a/app/core/src/main/java/stirling/software/SPDF/config/OpenApiConfig.java b/app/core/src/main/java/stirling/software/SPDF/config/OpenApiConfig.java index a25287c4d6..514b9231c6 100644 --- a/app/core/src/main/java/stirling/software/SPDF/config/OpenApiConfig.java +++ b/app/core/src/main/java/stirling/software/SPDF/config/OpenApiConfig.java @@ -62,10 +62,14 @@ public class OpenApiConfig { // Add server configuration from environment variable String swaggerServerUrl = System.getenv("SWAGGER_SERVER_URL"); + Server server; if (swaggerServerUrl != null && !swaggerServerUrl.trim().isEmpty()) { - Server server = new Server().url(swaggerServerUrl).description("API Server"); - openAPI.addServersItem(server); + server = new Server().url(swaggerServerUrl).description("API Server"); + } else { + // Use relative path so Swagger uses the current browser origin to avoid CORS issues when accessing via different ports + server = new Server().url("/").description("Current Server"); } + openAPI.addServersItem(server); // Add ErrorResponse schema to components Schema errorResponseSchema = diff --git a/frontend/src/core/constants/links.ts b/frontend/src/core/constants/links.ts index 294e993633..c48ea04ab3 100644 --- a/frontend/src/core/constants/links.ts +++ b/frontend/src/core/constants/links.ts @@ -1 +1 @@ -export const devApiLink = "/swagger-ui/index.html"; +export const devApiLink = "https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/";