
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
cds-swagger-ui-express
Advanced tools
An express middleware to serve OpenAPI definitions for CAP services in Swagger UI. Builds on top of swagger-ui-express.
In your project, execute
npm install --save-dev cds-swagger-ui-express
Have this in your server.js
:
const cds = require ('@sap/cds')
module.exports = cds.server
if (process.env.NODE_ENV !== 'production') {
const cds_swagger = require ('cds-swagger-ui-express')
cds.on ('bootstrap', app => app.use (cds_swagger()) )
}
Swagger UI is then served on /$api-docs/<service-path>
, like http://localhost:4004/$api-docs/browse/
Call cds_swagger ({...})
with the following object:
{
"basePath": "/$api-docs", // the root path to mount the middleware on
"diagram": "true" // whether to render the YUML diagram
}
If you call cds.serve
on your own in your server.js
, make sure to install this middleware before, as it relies on CDS' serving
events.
FAQs
Swagger UI for CAP Services
The npm package cds-swagger-ui-express receives a total of 2,911 weekly downloads. As such, cds-swagger-ui-express popularity was classified as popular.
We found that cds-swagger-ui-express demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.