koa2-throttling
中间件用来限制用户访问频率,防止一些爬虫频繁的抓取数据
一、使用方法
-
1、安装包
npm install koa2-throttling -
2、使用方式(在中间件中)
;{/*** ctx, 上下文* username, 登录用户* loginMaxLength = 5, 登录用户60s中访问次数* unknownMaxLength = 3 未登录用户60s中访问次数*/;await ;};
koa2-throttling
中间件用来限制用户访问频率,防止一些爬虫频繁的抓取数据
1、安装包
npm install koa2-throttling
2、使用方式(在中间件中)
; { /** * ctx, 上下文 * username, 登录用户 * loginMaxLength = 5, 登录用户60s中访问次数 * unknownMaxLength = 3 未登录用户60s中访问次数 */ ; await ;};
npm i koa2-throttling
1
0.0.1
MIT
7.57 kB
10