Skip to content

Commit 00412d3

Browse files
committed
Fix invalid swagger-ui path retrieval
1 parent d06aa2e commit 00412d3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var createSwaggerPage = (options) => {
1414
throw new Error('options.path is required');
1515
}
1616

17-
var swaggerUiPath = path.resolve(__dirname, 'node_modules', 'swagger-ui', 'dist');
17+
var swaggerUiPath = path.dirname(require.resolve('swagger-ui'));
1818

1919
var swaggerSpec = swaggerJSDoc({
2020
swaggerDefinition: {
@@ -27,7 +27,6 @@ var createSwaggerPage = (options) => {
2727
});
2828

2929
var publicPath = options.path.replace(/\/+$/, '');
30-
console.log(swaggerUiPath);
3130

3231
options.server.get(`${publicPath}/swagger.json`, (req, res, next) => {
3332
res.setHeader('Content-type', 'application/json');

0 commit comments

Comments
 (0)