diff --git a/README.md b/README.md index 3101364..85cb48f 100644 --- a/README.md +++ b/README.md @@ -223,11 +223,13 @@ const app = express(); const swaggerUi = require('swagger-ui-express'); const swaggerDocument = require('./swagger.json'); +var options = {} + app.use('/api-docs', function(req, res, next){ swaggerDocument.host = req.get('host'); req.swaggerDoc = swaggerDocument; next(); -}, swaggerUi.serve, swaggerUi.setup()); +}, swaggerUi.serveFiles(swaggerDocument, options), swaggerUi.setup()); ``` ### Two swagger documents diff --git a/index.js b/index.js index 9b74230..a8cd5ac 100644 --- a/index.js +++ b/index.js @@ -82,6 +82,7 @@ var htmlTplString = ` <% customJs %> +<% customJsStr %> <% customCssUrl %>