Skip to content

Refactor #494: Moved Rate Limiter configuration into a dedicated midd…#519

Open
jikrana1 wants to merge 2 commits into
niharika-mente:mainfrom
jikrana1:refactor/issue-494-rate-limiter
Open

Refactor #494: Moved Rate Limiter configuration into a dedicated midd…#519
jikrana1 wants to merge 2 commits into
niharika-mente:mainfrom
jikrana1:refactor/issue-494-rate-limiter

Conversation

@jikrana1

Copy link
Copy Markdown
Contributor

📋 Pull Request — Refactor Rate Limiter into Dedicated Middleware

🔗 Related Issue

Closes #494Refactor Rate Limiter Configuration into a Dedicated Middleware Module

✅ Changes Made

  • Extracted the rateLimit configuration logic from app.js.
  • Created a new ES Module file: middleware/rateLimiter.js.
  • Exported the configured limiter instance using export default.
  • Imported the limiter into app.js and applied it using app.use("/api", limiter);.

🧪 Testing Checklist

  • Server starts successfully without errors.
  • The /api routes are correctly rate-limited to 1000 requests per 15 minutes.
  • The existing rate-limiting behavior remains completely unchanged.

📌 Benefits Achieved

  • Cleaner app.js entry point.
  • Better Separation of Concerns (Rate limiting logic is isolated).
  • Easier reuse across different routes in the future if needed.

…dedicated middleware/rateLimiter.js module
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the niharika-mente's projects Team on Vercel.

A member of the Team first needs to authorize it.

Aamod007
Aamod007 previously approved these changes Jul 2, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aamod007 Aamod007 self-requested a review July 2, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Rate Limiter Configuration into a Dedicated Middleware Module

2 participants