Skip to content

Commit

Permalink
Increase rate limit to 60 requests per minute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Cardona committed Jul 1, 2018
1 parent 7f610d8 commit 00b4ee0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ app.use(cors())
app.enable('trust proxy');
let limiter = new RateLimit({
windowMs: 60000, // 1 minute
max: 40, // limit each IP to 20 requests per windowMs
max: 60, // limit each IP to 20 requests per windowMs
delayMs: 0, // disable delaying - full speed until the max limit is reached
handler: function (req, res, /*next*/) {
res.format({
json: function(){
res.status(500).json({ error: 'Too many requests. Limits are 40 requests per minute.'});
res.status(500).json({ error: 'Too many requests. Limits are 60 requests per minute.'});
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rest-cloud",
"version": "1.1.3",
"version": "1.1.4",
"private": true,
"scripts": {
"start": "node ./bin/www",
Expand Down

0 comments on commit 00b4ee0

Please sign in to comment.