
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
better-sails-swagger
Advanced tools
swagger.io (v2.0) hook for Sails. The application's models, controllers, and routes are aggregated and transformed into a Swagger Document. Supports the Swagger 2.0 specification.
$ npm install sails-swagger --save
// config/swagger.js
module.exports.swagger = {
/**
* require() the package.json file for your Sails app.
*/
pkg: require('../package'),
ui: {
url: 'http://swagger.balderdash.io'
}
};
After installing and configuring swagger, you can find the docs output on the /swagger/doc route.
You may also specify additional swagger endpoints by specifying the swagger spec in config/routes.js
/**
* Route Mappings
* @file config/routes.js
* (sails.config.routes)
*
* Your routes map URLs to views and controllers.
*/
module.exports.routes = {
/***************************************************************************
* *
* Make the view located at `views/homepage.ejs` (or `views/homepage.jade`, *
* etc. depending on your default view engine) your home page. *
* *
* (Alternatively, remove this and add an `index.html` file in your *
* `assets` directory) *
* *
***************************************************************************/
'/': {
view: 'homepage'
},
/***************************************************************************
* *
* Custom routes here... *
* *
* If a request to a URL doesn't match any of the custom routes above, it *
* is matched against Sails route blueprints. See `config/blueprints.js` *
* for configuration options and examples. *
* *
***************************************************************************/
'get /groups/:id': {
controller: 'GroupController',
action: 'test',
skipAssets: 'true',
//swagger path object
swagger: {
methods: ['GET', 'POST'],
summary: ' Get Groups ',
description: 'Get Groups Description',
produces: [
'application/json'
],
tags: [
'Groups'
],
responses: {
'200': {
description: 'List of Groups',
schema: 'Group', // api/model/Group.js,
type: 'array'
}
},
parameters: []
}
},
'put /groups/:id': {
controller: 'GroupController',
action: 'test',
skipAssets: 'true',
//swagger path object
swagger: {
methods: ['PUT', 'POST'],
summary: 'Update Groups ',
description: 'Update Groups Description',
produces: [
'application/json'
],
tags: [
'Groups'
],
responses: {
'200': {
description: 'Updated Group',
schema: 'Group' // api/model/Group.js
}
},
parameters: [
'Group' // api/model/Group.js
]
}
}
};
MIT
FAQs
Improved sails-swagger with route parameters definition
The npm package better-sails-swagger receives a total of 0 weekly downloads. As such, better-sails-swagger popularity was classified as not popular.
We found that better-sails-swagger 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.