sails-hook-rate-limit

0.0.2 • Public • Published

sails-hook-rate-limit

This Sails hook is a wrapper of express-rate-limit

Installation

npm i --save sails-hook-rate-limit

Setup

Create a rate-limit.js config file in config/.

module.exports.rateLimit = {
  windowMs: 10 * 60 * 1000 // 10 minutes
  max: 100,
  standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
  legacyHeaders: false, // Disable the `X-RateLimit-*` headers
}

The config object takes the same properties and methods as described in the configuration docs of express-rate-limit

Package Sidebar

Install

npm i sails-hook-rate-limit

Weekly Downloads

5

Version

0.0.2

License

MIT

Unpacked Size

3.98 kB

Total Files

6

Last publish

Collaborators

  • dominuskelvin