Skip to content

Commit

Permalink
Implement rate limiting to prevent abuse and ensure service stability
Browse files Browse the repository at this point in the history
Fixes #40

Implement rate limiting to prevent excessive requests and ensure service stability.

* Add `express-rate-limit` middleware to `pages/api/exam-result.js` and `pages/api/scholarship-data.js` to limit requests to 100 per 15 minutes per IP address.
* Handle blocked requests gracefully by returning a 429 status code with a custom message in both API files.
* Update `package.json` to include `express-rate-limit` dependency.
* Add logic to `pages/college_predictor.js` and `pages/scholarships_result.js` to handle 429 status code and display a "Rate limit exceeded" message to the user.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/avantifellows/college-predictor/issues/40?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
thedemonsid committed Oct 22, 2024
1 parent 5a93c85 commit 91f4909
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 3,528 deletions.
Loading

0 comments on commit 91f4909

Please sign in to comment.