This repository has been archived on 2026-07-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
aniwatch-api/src/config/ratelimit.ts
T
Ayush Choudhary c3ee76a06b Added .env.example
2024-02-28 12:42:05 +00:00

12 lines
337 B
TypeScript

import { rateLimit } from "express-rate-limit";
import { config } from "dotenv";
config();
export const ratelimit = rateLimit({
windowMs: Number(process.env.WINDOWMS) || 30 * 60 * 1000,
max: Number(process.env.MAX) || 70,
legacyHeaders: true,
standardHeaders: "draft-7",
message: "Too many API requests, try again later",
});