0.1.0 • Published 10 years ago

ultra-throttle v0.1.0

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
10 years ago

Build Status Code Climate Test Coverage Dependency Status devDependency Status

ultra-throttle

NodeJS/MongoDB Rate-Limiting Middleware

Usage

const throttle = require('ultra-throttle')({mongoose});
const HITS_PER_WINDOW = 100;
app.get('/my-stuff', [throttle('getMyStuff', HITS_PER_WINDOW)], (req, res, next) => {...});

Configuration Options

  • mongoose - (required) - the Mongoose instance to attach the RateBucket models to
  • ttl - (optional, default: 5 minutes) - The time-window for throttling across the application. Expressed in seconds.

Based on https://apicatus-laboratory.rhcloud.com/2014/04/13/rate-limit-your-nodejs-api-with-mongodb/

0.1.0

10 years ago