Skip to content

Commit

Permalink
Document new options param on handler
Browse files Browse the repository at this point in the history
  • Loading branch information
nfriedly committed Oct 12, 2021
1 parent 5cf1129 commit 184eee8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -187,14 +187,14 @@ function (req /*, res*/) {

### handler

The function to handle requests once the max limit is exceeded. It receives the request and the response objects. The "next" param is available if you need to pass to the next middleware.
The function to handle requests once the max limit is exceeded. It receives the request and the response objects. The "next" param is available if you need to pass to the next middleware. Finally, the options param has all of the options that originally passed in when creating the current limiter and the default values for other options.

The`req.rateLimit` object has `limit`, `current`, and `remaining` number of requests and, if the store provides it, a `resetTime` Date object.

Defaults to:

```js
function (req, res, /*next*/) {
function (req, res, next, options) {
res.status(options.statusCode).send(options.message);
}
```
Expand Down

0 comments on commit 184eee8

Please sign in to comment.