diff --git a/lib/swagger-express/index.js b/lib/swagger-express/index.js index 02587d25..5058cca6 100644 --- a/lib/swagger-express/index.js +++ b/lib/swagger-express/index.js @@ -176,23 +176,6 @@ exports.init = function (app, opt) { // Serve up swagger ui at /swagger via static route var swHandler = express['static'](opt.swaggerUI); - // Overwrite swagger-ui discoveryUrl base on basePath - fs.readFile(opt.swaggerUI + '/index.html', function (err, data) { - if (err) { - return err; - } - - var html = data.toString(); - var regex = /discoveryUrl:(.*?),/; - - html = html.replace(regex, 'discoveryUrl: "' + opt.basePath + '/api-docs.json",'); - - fs.writeFile(opt.swaggerUI + '/index.html', html, function (err) { - if (err) { - throw err; - } - }); - }); // Serve up swagger ui interface. var swaggerURL = new RegExp('^'+ opt.swaggerURL +'(\/.*)?$');