constRateLimit=require('koa2-ratelimit').RateLimit;constKoaRouter=require('koa-router');constrouter=newKoaRouter();constgetUserLimiter=RateLimit.middleware({interval:15*60*1000,// 15 minutesmax:100,prefixKey:'get/user/:id'// to allow the bdd to Differentiate the endpoint});// add route ...
RateLimit; const Stores = require('koa2-ratelimit').Stores; //Detailed Redis Configuration Reference: https://github.com/redis/node-redis/blob/master/docs/client-configuration.md RateLimit.defaultOptions({ message: 'Get out.', store: new Stores.Redis({ socket: { host: 'redis_host', port...
For an API-only server where the rate-limiter should be applied to all requests: constRateLimit=require('koa2-ratelimit').RateLimit;constlimiter=RateLimit.middleware({interval:{min:15},// 15 minutes = 15*60*1000max:100,// limit each IP to 100 requests per interval});// apply to all...
Rate limiter middleware for koa. Latest version: 0.0.1, last published: 9 years ago. Start using koa-ratelimit2 in your project by running `npm i koa-ratelimit2`. There are no other projects in the npm registry using koa-ratelimit2.
ysocorp/koa2-ratelimitPublic Notifications Fork38 Star117 Breadcrumbs koa2-ratelimit / Latest commit Cannot retrieve latest commit at this time. History History File metadata and controls Code Blame 1 lines (1 loc) · 13 Bytes Raw node_modules...
Rate-limiting middleware for Koa2 ES6. Use to limit repeated requests to APIs and/or endpoints such as password reset. - Labels · ysocorp/koa2-ratelimit
Rate-limiting middleware for Koa2 ES6. Use to limit repeated requests to APIs and/or endpoints such as password reset. - ysocorp/koa2-ratelimit