Skip to content

Commit

Permalink
Merge pull request #59 from phaux/patch-1
Browse files Browse the repository at this point in the history
use relative path to swagger json
  • Loading branch information
SaltyAom committed Nov 16, 2023
2 parents c92aa0f + cc64dec commit 94726c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export const swagger =
...documentation.info
}

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

app.get(path, () => {
const combinedSwaggerOptions = {
url: `${pathWithPrefix}/json`,
url: `${relativePath}/json`,
dom_id: '#swagger-ui',
...swaggerOptions
}
Expand Down

0 comments on commit 94726c3

Please sign in to comment.