ultra-throttle
NodeJS API Throttling Middleware
Last updated 5 years ago by darthtrevino .
Apache-2.0 · Original npm · Tarball · package.json
$ cnpm install ultra-throttle 
SYNC missed versions from official npm registry.

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/

Current Tags

  • 0.1.0                                ...           latest (5 years ago)

1 Versions

  • 0.1.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (26)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |