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

Feature/rate limiter #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

kalee88
Copy link

@kalee88 kalee88 commented Jan 6, 2024

In the top layer I have added the middleware.ts file that runs prior to a completed request. The middleware.ts file fetches the rate-limit page and returns if the limit is reached. If the limit is reached, it will redirect to the 429.ts error page; if not the request continues. The ratelimit.ts file keeps track of the number of request per time period and delays if excessive request are called within a short time frame. The counter for number of requests within a time period utilizes the Express library from node.js and can be IP based. However it cannot access the client's IP due to the next.js framework hiding it.

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

Successfully merging this pull request may close these issues.

None yet

1 participant