Skip to content

Commit

Permalink
Update doc for basic rate limiter whitelist (specific IPs only) + fix…
Browse files Browse the repository at this point in the history
… minor orthograph
  • Loading branch information
zguig52 committed Nov 28, 2024
1 parent d059d2b commit 848cacb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/content/3.middleware/1.rate-limiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type RateLimiter = {
tokensPerInterval: number;
interval: number;
headers: boolean;
whiteList: string[];
throwError: boolean;
driver: {
name: string;
Expand All @@ -82,11 +83,17 @@ The time value in miliseconds after which the rate limiting will be reset. For e

When set to `true` it will set the response headers: `X-Ratelimit-Remaining`, `X-Ratelimit-Reset`, `X-Ratelimit-Limit` with appriopriate values.

### `whiteList`

- Default: `undefined`

When set to `['127.0.0.1', '192.168.0.1']` it will skip rate limiting for these specific IPs.

### `throwError`

- Default: `true`

Whether to throw Nuxt Error with appriopriate error code and message. If set to false, it will just return the object with the error that you can handle.
Whether to throw Nuxt Error with appropriate error code and message. If set to false, it will just return the object with the error that you can handle.

### `driver`

Expand Down

0 comments on commit 848cacb

Please sign in to comment.