Skip to content

Commit

Permalink
rate limiting
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Jan 8, 2025
1 parent 7a090bf commit 6ae2e5e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/rate.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const limited = async ip => {
const visits = await redis.INCR(key);
if (visits === 1) await redis.EXPIRE(key, 60);
await redis.disconnect();
console.log(visits)
return false;
return visits > reqLimit;
}
Expand Down

0 comments on commit 6ae2e5e

Please sign in to comment.