You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

redoc-express

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redoc-express - npm Package Compare versions

Comparing version
2.1.0
to
2.1.1
+1
-1
package.json
{
"name": "redoc-express",
"version": "2.1.0",
"version": "2.1.1",
"description": "Express Middleware for OpenAPI/Swagger-generated API Reference Documentation",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

import { Ioption } from './redoc-html-template';
declare function redocExpressMiddleware(options?: Ioption): any;
export default redocExpressMiddleware;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var redoc_html_template_1 = require("./redoc-html-template");
function redocExpressMiddleware(options) {
if (options === void 0) { options = {
title: 'ReDoc',
specUrl: 'http://petstore.swagger.io/v2/swagger.json'
}; }
return function middleware(req, res) {
res.type('html');
res.send((0, redoc_html_template_1.redocHtml)(options));
};
}
exports.default = redocExpressMiddleware;
module.exports = redocExpressMiddleware;
module.exports.default = redocExpressMiddleware;
export interface Ioption {
title: string;
specUrl: string;
nonce?: string;
redocOptions?: object;
}
declare function redocHtml(options?: Ioption): string;
export { redocHtml };
export default redocHtml;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.redocHtml = void 0;
var html = "<!DOCTYPE html>\n<html>\n <head>\n <title>[[title]]</title>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\" rel=\"stylesheet\" />\n <style>\n body {\n margin: 0;\n padding: 0;\n }\n </style>\n </head>\n <body>\n <div id=\"redoc-container\"></div>\n <script nonce='[[nonce]]' src=\"https://unpkg.com/redoc@latest/bundles/redoc.standalone.js\"> </script>\n </body>\n <script>\n Redoc.init(\n \"[[spec-url]]\",\n [[options]],\n document.getElementById(\"redoc-container\")\n );\n </script>\n</html>";
function redocHtml(options) {
if (options === void 0) { options = {
title: 'ReDoc',
specUrl: 'http://petstore.swagger.io/v2/swagger.json'
}; }
var title = options.title, specUrl = options.specUrl, _a = options.nonce, nonce = _a === void 0 ? '' : _a, _b = options.redocOptions, redocOptions = _b === void 0 ? {} : _b;
return html
.replace('[[title]]', title)
.replace('[[spec-url]]', specUrl)
.replace('[[nonce]]', nonce)
.replace('[[options]]', JSON.stringify(redocOptions));
}
exports.redocHtml = redocHtml;
exports.default = redocHtml;