Skip to content

Commit d88319d

Browse files
authored
Fix serveDocs()
Modify the replace call so that the specification in the template ends up as a JS object and not a string, which causes issues with SwaggerUIBundle.
1 parent c9f6d19 commit d88319d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function serveDocs(app: App, opts: serveOptions) {
9898
const __dirname = dirname(modulePath)
9999

100100
const template = readFileSync(resolve(__dirname, 'template.html'), 'utf8')
101-
const html = template.replace('"##docs##"', strDocs).replace('"##title##"', opts.title)
101+
const html = template.replace("'##docs##'", strDocs).replace('"##title##"', opts.title)
102102

103103
app.get('/' + prefix, (_req: Request, res: Response) => {
104104
res.status(200).send(html)

0 commit comments

Comments
 (0)