Skip to content

Commit

Permalink
update ratelimitier
Browse files Browse the repository at this point in the history
  • Loading branch information
Lavish883 authored Jan 8, 2024
1 parent 4fd63f3 commit bb252fe
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
.env
.env
2 changes: 2 additions & 0 deletions mainJS/rateLimiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ const databaseAccessLimiter = rateLimiter({
max: 50,
windowMS: 5000, // 5 seconds
message: "You can't make any more requests at the moment. Try again later",
validate: {xForwardedForHeader: false}
});

const imageLimiter = rateLimiter({
max: 100,
windowMS: 2500, // 5 seconds
validate: {xForwardedForHeader: false}
});

module.exports = {
Expand Down
Loading

0 comments on commit bb252fe

Please sign in to comment.