mw/rate-limit
Per-IP request throttling with standard RateLimit headers, for Express, Fastify or Hono.
Provides: middleware:rate-limit
Requires: http
Dependencies
express-rate-limit@^7.5.1(whenhas('http/express'))@fastify/rate-limit@^10.3.0(whenhas('http/fastify'))hono-rate-limiter@^0.4.2(whenhas('http/hono'))
What it contributes to other files
| File | Slot | Line |
|---|---|---|
src/app.ts|js | imports | import rateLimit from 'express-rate-limit'; |
src/app.ts|js | middleware | app.use( |
src/app.ts|js | imports | import fastifyRateLimit from '@fastify/rate-limit'; |
src/app.ts|js | middleware | await app.register(fastifyRateLimit, { max: 100, timeWindow: '1 minute' }); |
src/app.ts|js | imports | import { rateLimiter } from 'hono-rate-limiter'; |
src/app.ts|js | middleware | app.use( |
Use it
atarashi new my-app --add mw/rate-limit
atarashi add mw/rate-limit
Version 1.0.0. Format reference: Authoring blueprints.
Part of the atarashi documentation, written and maintained by Gautam Suthar.