TerminalWitchcraft / actix-ratelimit

Rate limiter framework for Actix web
MIT License
126 stars 25 forks source link

RateLimit per API level? #4

Closed gembin closed 4 years ago

gembin commented 4 years ago

Is it possible to control the rate limit at per API level?

For example: GET /foo 100 max requests per minute GET /bar 200 max requests per minute

TerminalWitchcraft commented 4 years ago

Yes, it is possible to wrap different instances(You can configure each instance separately according to your needs, like max requests, etc) of this ratelimit middleware to different "scopes" of your app. More information can be found here: https://docs.rs/actix-web/3.0.0-beta.1/actix_web/struct.Scope.html

Hope this helps!

TerminalWitchcraft commented 4 years ago

Closing this for now. Feel free to reopen if you have any questions.