Skip to content

Rate-limit methods and publications. Lightweight. Simple.

License

Notifications You must be signed in to change notification settings

leaonline/ratelimit-factory

Repository files navigation

Ratelimit Factory

JavaScript Style Guide Project Status: Active – The project has reached a stable, usable state and is being actively developed. GitHub file size in bytes GitHub

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

import { 
  runRateLimiter,
  rateLimitMethod,
  rateLimitMethods,
  rateLimitPublication,
  rateLimitPublications, 
  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

Releases

No releases published

Packages

No packages published