Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement rate limiting to prevent abuse and ensure service stability
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