diff --git a/src/index.ts b/src/index.ts index 437729d..fbf4d26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -85,7 +85,7 @@ export const swagger = async ( const scalarConfiguration: ReferenceConfiguration = { spec: { ...scalarConfig.spec, - url: `${request.url}/json` + url: `${new URL(request.url).pathname.replace(/\/$/, "")}/json` }, ...scalarConfig, // so we can showcase the elysia theme