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.
$ meteor add leaonline:ratelimit-factory
Then import the specific functions via
import {
runRateLimiter,
rateLimitMethod,
rateLimitMethods,
rateLimitPublication,
rateLimitPublications,
rateLimitAccounts } from 'meteor/leaonline:ratelimit-factory'
You can simply omit the functions you don't need.
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
MIT, see license file