connection limit middlware for koa
Installation
$ npm install koa-connection-limit
API
const koa = ;const koaConnectionLimit = ;const app = ; app;
Options
mid
mid connection limit counthigh
high connection limit countthrowError
whentrue
orundefined
, the connection count reach high limit count, it will throw errorpass
if the function return true, the request will be ingore of limiterr
the custom define error, optional
onChange
when status change, the function will be triggered
Example
'use strict';const Koa = ;const app = ;const koaConnectionLimit = ; // logger app; app; app; // response app; app;
License
MIT