Skip to content

Commit

Permalink
improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yagikota authored and aldas committed Jun 15, 2023
1 parent b81356d commit 1a0e754
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion website/content/middleware/rate-limiter.md
Expand Up @@ -13,13 +13,15 @@ may not be the best option for a high number of concurrent requests or a large n

### Usage

To add a rate limit to your application simply add the `RateLimiter` middlware.
To add a rate limit to your application simply add the `RateLimiter` middleware.
The example below will limit the application to 20 requests/sec using the default in-memory store:

```go
e.Use(middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(20)))
```

Note: if the provided rate is a float number, Burst will be treated as the rounded down value of the rate.

## Custom Configuration

```go
Expand Down

0 comments on commit 1a0e754

Please sign in to comment.