Problem Statement
How can you implement API rate limiting in Node.js?
Explanation
Use packages like `express-rate-limit` or Redis-based counters to restrict requests per user or IP. It protects servers from abuse and ensures fair usage.
Code Solution
SolutionRead Only
import rateLimit from 'express-rate-limit';
const limiter=rateLimit({windowMs:60000,max:100});
app.use(limiter);