express-ratelimiter
This project is not affiliated with "express" (Not official)
Work In Progress, you shouldn't confidently use this in production. (It does work though)
How to use (simple example):
const express = ; const app = ; const IndexRoute = ;const indexRoute = timePassedBetween: 1000 // 1000ms, the min time passed between two requests. DEFAULT: 50ms maxPerMinute: 3 // max amount of requests per minute. DEFAULT: Number.MAX_SAFE_INTEGER ; app; app;
IndexRoute.js:
const ExpressRoute = ; res; moduleexports = IndexRoute;
To change the responses to blocked requests override the ExpressRoute.requestBlocked method. Current form:
resstatus429;