UNPKG

guox-express

Version:

GuOx: Ultimate enterprise‑grade, AI & WASM‑powered Express security framework

10 lines (8 loc) 358 B
import rateLimit from 'express-rate-limit'; import { RequestHandler } from 'express'; export default function RateLimiter(cfg?: any): RequestHandler { const opts = { windowMs:cfg?.windowMs||60000, max:cfg?.max||100, message:'Too many requests' }; const mw = rateLimit(opts); Object.defineProperty(mw, 'name', { value: 'RateLimiter' }); return mw; }