diff --git a/src/index.ts b/src/index.ts index 4ca0a51..437729d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -66,7 +66,7 @@ export const swagger = async ( const app = new Elysia({ name: '@elysiajs/swagger' }) - app.get(path, function documentation() { + app.get(path, function documentation({request}) { const combinedSwaggerOptions = { url: openAPISpecUrl, dom_id: '#swagger-ui', @@ -85,7 +85,7 @@ export const swagger = async ( const scalarConfiguration: ReferenceConfiguration = { spec: { ...scalarConfig.spec, - url: openAPISpecUrl + url: `${request.url}/json` }, ...scalarConfig, // so we can showcase the elysia theme