Update src/index.ts

Co-authored-by: Jozef Mikuláš <jmikulas.sk@gmail.com>
This commit is contained in:
Saurabh Bhalerao
2025-02-21 16:34:51 +05:30
committed by GitHub
parent 4d4823599d
commit a4229eb6ac

View File

@@ -85,7 +85,7 @@ export const swagger = async <Path extends string = '/swagger'>(
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