Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
redoc-express
Advanced tools
Express Middleware for OpenAPI/Swagger-generated API Reference Documentation
Express Middleware for OpenAPI/Swagger-generated API Reference Documentation
npm install redoc-express
const express = require('express');
const redoc = require('redoc-express');
const app = express();
const port = 3000;
// serve your swagger.json file
app.get('/docs/swagger.json', (req, res) => {
res.sendFile('swagger.json', { root: '.' });
});
// define title and specUrl location
// serve redoc
app.get(
'/docs',
redoc({
title: 'API Docs',
specUrl: '/docs/swagger.json',
nonce: '', // <= it is optional,we can omit this key and value
// we are now start supporting the redocOptions object
// you can omit the options object if you don't need it
// https://redocly.com/docs/api-reference-docs/configuration/functionality/
redocOptions: {
theme: {
colors: {
primary: {
main: '#6EC5AB'
}
},
typography: {
fontFamily: `"museo-sans", 'Helvetica Neue', Helvetica, Arial, sans-serif`,
fontSize: '15px',
lineHeight: '1.5',
code: {
code: '#87E8C7',
backgroundColor: '#4D4D4E'
}
},
menu: {
backgroundColor: '#ffffff'
}
}
}
})
);
app.listen(port, () => console.log(`Example app listening on port ${port}!`));
npm i
npm t
MIT © Aung Myo Kyaw
FAQs
Express Middleware for OpenAPI/Swagger-generated API Reference Documentation
The npm package redoc-express receives a total of 20,667 weekly downloads. As such, redoc-express popularity was classified as popular.
We found that redoc-express demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.