Rate limiting
A way to avoid too many requests at once from a single source.
yarn add @nestjs/throttlerTHROTTLER_TTL = 60
THROTTLER_LIMIT = 10Joi.number().integer().positive().required(),export default registerAs('throttler', () => {
const config = [
{
ttl: seconds(+process.env.THROTTLER_TTL),
limit: +process.env.THROTTLER_LIMIT,
},
] as const satisfies ThrottlerModuleOptions;
return config;
});Last updated