diff options
| author | Ritesh Ghosh <[email protected]> | 2024-03-03 20:04:22 +0530 |
|---|---|---|
| committer | Ritesh Ghosh <[email protected]> | 2024-03-03 20:04:22 +0530 |
| commit | eea621b17a14363b003382ea237cd43361bc5df9 (patch) | |
| tree | 68cc67df7709baa3ff4ab938d9136b95cce08f43 /src/config | |
| parent | 5562885184e892743f14df199a21d9521deeb989 (diff) | |
| parent | d779537275ebd9395189f9178b0422ad0439851f (diff) | |
| download | aniwatch-api-eea621b17a14363b003382ea237cd43361bc5df9.tar.xz aniwatch-api-eea621b17a14363b003382ea237cd43361bc5df9.zip | |
feat: merge 'main' of https://github.com/ghoshRitesh12/aniwatch-api
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/ratelimit.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config/ratelimit.ts b/src/config/ratelimit.ts index 9bf70c2..75cb1f8 100644 --- a/src/config/ratelimit.ts +++ b/src/config/ratelimit.ts @@ -1,8 +1,10 @@ import { rateLimit } from "express-rate-limit"; +import { config } from "dotenv"; +config(); export const ratelimit = rateLimit({ - windowMs: 30 * 60 * 1000, - max: 70, + windowMs: Number(process.env.WINDOWMS) || 30 * 60 * 1000, + max: Number(process.env.MAX) || 70, legacyHeaders: true, standardHeaders: "draft-7", message: "Too many API requests, try again later", |
