Skip to content

Commit 94726c3

Browse files
authored
Merge pull request #59 from phaux/patch-1
use relative path to swagger json
2 parents c92aa0f + cc64dec commit 94726c3

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
@@ -46,11 +46,11 @@ export const swagger =
4646
...documentation.info
4747
}
4848

49-
const pathWithPrefix = `${app.config.prefix}${path}`
49+
const relativePath = path.startsWith('/') ? path.slice(1) : path
5050

5151
app.get(path, () => {
5252
const combinedSwaggerOptions = {
53-
url: `${pathWithPrefix}/json`,
53+
url: `${relativePath}/json`,
5454
dom_id: '#swagger-ui',
5555
...swaggerOptions
5656
}

0 commit comments

Comments
 (0)