feat: api endpoints throttle (#837)

* feat: api endpoints throttle
This commit is contained in:
Ahmed Bouhuolia
2025-10-30 22:06:05 +02:00
committed by GitHub
parent 844a050c9a
commit 41143d8bbd
8 changed files with 215 additions and 119 deletions

View File

@@ -0,0 +1,14 @@
import { registerAs } from '@nestjs/config';
export default registerAs('throttle', () => ({
global: {
ttl: parseInt(process.env.THROTTLE_GLOBAL_TTL ?? '60000', 10),
limit: parseInt(process.env.THROTTLE_GLOBAL_LIMIT ?? '100', 10),
},
auth: {
ttl: parseInt(process.env.THROTTLE_AUTH_TTL ?? '60000', 10),
limit: parseInt(process.env.THROTTLE_AUTH_LIMIT ?? '10', 10),
},
}));