Skip to content

Commit 4d48235

Browse files
Fix path issue in Swagger and Scalar config
1 parent f2b62fa commit 4d48235

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const swagger = async <Path extends string = '/swagger'>(
6666

6767
const app = new Elysia({ name: '@elysiajs/swagger' })
6868

69-
app.get(path, function documentation() {
69+
app.get(path, function documentation({request}) {
7070
const combinedSwaggerOptions = {
7171
url: openAPISpecUrl,
7272
dom_id: '#swagger-ui',
@@ -85,7 +85,7 @@ export const swagger = async <Path extends string = '/swagger'>(
8585
const scalarConfiguration: ReferenceConfiguration = {
8686
spec: {
8787
...scalarConfig.spec,
88-
url: openAPISpecUrl
88+
url: `${request.url}/json`
8989
},
9090
...scalarConfig,
9191
// so we can showcase the elysia theme

0 commit comments

Comments
 (0)