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

Implementation of the task #172

Closed
wants to merge 2 commits into from
Closed

Conversation

hakgrig1998
Copy link

For using middleware you need to:

1)Call builder.Services.RegisterRateLimiterServices(builder.Configuration); (Register Rate Limiter required services).
2) Use app.UseMiddleware();
3) Add configuration for rules ex:
"Rules": [
{
"Endpoint": "/api/v1/Test/GetAll",
"Action": "GET",
"Name": "LimitPeriodRule",
"RequestPeriod": 60,
"RequestLimit": 4
},
{
"Endpoint": "/api/v1/Test/GetAll",
"Action": "GET",
"Name": "RequestIntervalRule",
"RequestPeriod": 10
},
{
"Endpoint": "/api/v1/Test/Get",
"Action": "GET",
"Name": "RequestIntervalRule",
"RequestPeriod": 5
},
{
"Endpoint": "/api/v1/Test/Post",
"Action": "POST",
"Name": "RequestIntervalRule",
"RequestPeriod": 10
}
],

I have created an test api project, for testing you need to run it and pass a token.

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.

2 participants