Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate Limiter windows #351

Open
gyuray-dev opened this issue Jan 14, 2025 · 0 comments
Open

Rate Limiter windows #351

gyuray-dev opened this issue Jan 14, 2025 · 0 comments

Comments

@gyuray-dev
Copy link

Firstly, I find your project to be really useful. Thank you very much.

In the rate limiter, I'm wondering why the number 15 * 60 is multiplied by the ms parameter. It actually seems to enlarge the window size, resulting in the normal requests being blocked.


src/common/middleware/rateLimiter.ts

import type { Request } from "express";
import { rateLimit } from "express-rate-limit";

import { env } from "@/common/utils/envConfig";

const rateLimiter = rateLimit({
  ...
  windowMs: 15 * 60 * env.COMMON_RATE_LIMIT_WINDOW_MS,
  ...
});

export default rateLimiter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant