swagger-ui-express
Advanced tools
Comparing version 2.0.4 to 2.0.5
15
index.js
@@ -21,10 +21,15 @@ 'use strict' | ||
} | ||
var htmlWithSwaggerReplaced = html.toString().replace('<% swaggerDoc %>', swaggerDoc ? JSON.stringify(swaggerDoc) : 'undefined'); | ||
var favIconString = customfavIcon ? '<link rel="icon" href="' + customfavIcon + '" />' : favIconHtml; | ||
var indexHTML = htmlWithSwaggerReplaced.replace('<% customOptions %>', stringify(options)) | ||
var htmlWithCustomCss = indexHTML.replace('<% customCss %>', customCss); | ||
var htmlWithCustomCss = html.toString().replace('<% customCss %>', customCss); | ||
var htmlWithFavIcon = htmlWithCustomCss.replace('<% favIconString %>', favIconString); | ||
var htmlWithSwaggerUrl = htmlWithFavIcon.replace('<% swaggerUrl %>', swaggerUrl ? '"' + swaggerUrl + '"' : 'undefined') | ||
return function(req, res) { res.send(htmlWithSwaggerUrl) }; | ||
var initOptions = { | ||
swaggerDoc: swaggerDoc || undefined, | ||
customOptions: options, | ||
swaggerUrl: swaggerUrl || undefined | ||
} | ||
var htmlWithOptions = htmlWithFavIcon.replace('<% swaggerOptions %>', JSON.stringify(initOptions)) | ||
return function(req, res) { res.send(htmlWithOptions) }; | ||
}; | ||
@@ -31,0 +36,0 @@ |
{ | ||
"name": "swagger-ui-express", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Swagger UI Express", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1865766
16
7242