-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✏️ Optimize - Rate Limiting #427 - Add rate limiting
- Loading branch information
alexlee-dev
committed
Nov 9, 2020
1 parent
45c85f2
commit b803a21
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import rateLimit from "express-rate-limit"; | ||
|
||
const rateLimiter = rateLimit({ | ||
windowMs: 24 * 60 * 60 * 1000, // 24 hrs in milliseconds | ||
max: 100, | ||
message: "You have exceeded the limit of requests.", | ||
headers: true, | ||
}); | ||
|
||
export default rateLimiter; |