neg-ratelimiter
v1.0.0
Published
a express middleware for rate limit in Newegg
Downloads
4
Maintainers
Readme
neg-ratelimiter
A express middleware for rate limit in Newegg
Install
$ npm install neg-ratelimiter
How to Use
'use strict';
var express = require('express');
var nair = require('neg-nair');
var negLimiter = require('neg-ratelimiter');
var options = {
hosts: hosts,
nairDBUri: uri,
debug_mode: true
};
nair.init(options, (err) => { //need a few seconds to init connection
if(err){
console.log(err);
}else{
console.log('init success');
}
}
var opts = {
area: 5,
nair: nair,
max: 10,
duration: 20
};
var app = express();
app.use(negLimiter(opts));
License
MIT