2.0.2 • Published 3 years ago

@machiavelli/express-rate-limiter v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

express-rate-limiter

express-rate-limit is a simple, but effective express.js rate limiter by req.session.userId and req.path as a compound unique key. optionally another field from req.body can be added to the compound key through options.customField Allows one request at a time. MongoDB is used for the store.

Usage

import rateLimiter from '@machiavelli/express-rate-limiter';
app.use(rateLimiter({options}));

options

{
  client: MongoClient;        // MongoDb client
  collectionName: string;     // collection for store
  customField?: { name: string; reqBodyProp: string }; // custom field to be added to compound key
  excludePaths: string[];     // route paths to exclude from rate limit
  expireAfterSeconds: number; // after how many seconds rate limit expires
}
2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago