swagger-ui-express
Advanced tools
Comparing version 1.0.6 to 1.0.7
13
index.js
@@ -12,5 +12,10 @@ 'use strict' | ||
var setup = function(swaggerDoc, explorer, options, customCss) { | ||
var favIconHtml = '<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />' + | ||
'<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />' | ||
var setup = function(swaggerDoc, explorer, options, customCss, customfavIcon) { | ||
options = options || {}; | ||
customCss = customCss || ''; | ||
customfavIcon = customfavIcon || false; | ||
var html = fs.readFileSync(__dirname + '/indexTemplate.html'); | ||
@@ -24,7 +29,9 @@ try { | ||
var explorerString = explorer ? explorerHtml : ''; | ||
var favIconString = customfavIcon ? '<link rel="icon" href="' + customfavIcon + '" />' : favIconHtml; | ||
var explorerHtmlWithSwagger = htmlWithSwaggerReplaced.replace('<% explorerString %>', explorerString); | ||
var indexHTML = explorerHtmlWithSwagger.replace('<% customOptions %>', JSON.stringify(options)) | ||
var htmlWithCustomCss = indexHTML.replace('<% customCss %>', customCss); | ||
var htmlWithCustomCss = indexHTML.replace('<% customCss %>', customCss); | ||
var htmlWithFavIcon = htmlWithCustomCss.replace('<% favIconString %>', favIconString); | ||
return function(req, res) { res.send(htmlWithCustomCss) }; | ||
return function(req, res) { res.send(htmlWithFavIcon) }; | ||
}; | ||
@@ -31,0 +38,0 @@ |
{ | ||
"name": "swagger-ui-express", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"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
3005005
35165