You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,9 @@ Update your _config/services.yml_ like this:
75
75
You can also create your own rate limit modifier by implementing `RateLimitModifierInterface` and tagging your service accordingly.
76
76
77
77
### Configure your routes
78
+
79
+
#### With annotations
80
+
78
81
Add the `@RateLimit()` annotation to your controller methods (by default, the limit will be 1000 requests per minute).
79
82
This annotation accepts parameters to customize the rate limit. The following example shows how to limit requests on a route at the rate of 10 requests max every 2 minutes.
80
83
:warning: This customization only works if the `limit_by_route` parameter is `true`
@@ -101,3 +104,21 @@ This annotation requires a list of endpoints and accepts parameters to customize
101
104
* )
102
105
*/
103
106
```
107
+
108
+
#### In YAML
109
+
110
+
You also may add your rate limits in configuration files (Yaml) with the route name. If `period` or `limit` is not
111
+
defined for a route, the bundle will take the common option.
0 commit comments