Open
Description
Is there an existing issue that is already proposing this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe it
My challenge is how to apply throttling to a specific route without setting up a global throttle. My concern arises from the necessity to log every single request from every single user (in memory) when establishing a global throttling system, to ascertain whether the new request necessitates throttling. How can I accomplish this?
Describe the solution you'd like
Globally config it like:
imports: [
...
ThrottlerModule.forRoot()
]
and use it like this on the route:
@Throttle([{ limit: 3, ttl: 60000 }])
@Get()
findAll() {
return "List users works with custom rate limiting.";
}
Notes:
- It's better to remove the default keyword on the Throttle decorator
- It's good to add support for arrays inside the Throttle decorator
- I have tested the global config and added a guard with an empty config and it doesn't work.
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
For more customizations and more control for throttling and saving more space.
Metadata
Metadata
Assignees
Labels
No labels