2.0.2 • Published 2 years ago

@machiavelli/express-rate-limiter v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.10

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago