Ratelimit Factory
Rate-limit methods and publications. Lightweight. Simple.
All code is ~200 lines and includes a full registry class to handle register and running the rate limiter.
Install and import
$ meteor add leaonline:ratelimit-factory
Then import the specific functions via
1import { 2 runRateLimiter, 3 rateLimitMethod, 4 rateLimitMethods, 5 rateLimitPublication, 6 rateLimitPublications, 7 rateLimitAccounts } from 'meteor/leaonline:ratelimit-factory'
You can simply omit the functions you don't need.
Usage
You can use these functions to rate limit all Methods and Publications on your Meteor backend.
After you have added all Methods/Publications, you can execute the rate limier using runRateLimiter
and pass a callback function which is executed on limit exceeded.
For a detailed usage, you can lookup the API documentation
License
MIT, see license file