It would be nice to have cost param like:
app.use(
rateLimiter({
windowMs: 15 * 60 * 1000, // 15 minutes
limit: 100, // Limit each IP to 100 requests per `window` (here, per 15 minutes).
standardHeaders: "draft-6", // draft-6: `RateLimit-*` headers; draft-7: combined `RateLimit` header
keyGenerator: (c) => "<unique_key>", // Method to generate custom identifiers for clients.
costCalculator: (c) => { return 2; }
})
);
e.g. based on query params one could decide that the cost for a certain call is more expensive.
this cost should then be used in the counter.
It would be nice to have cost param like:
e.g. based on query params one could decide that the cost for a certain call is more expensive.
this cost should then be used in the counter.