Rate Limiting
API rate limiting and throttling configuration powered by @nestjs/throttler.
Configuration
Rate limiting is enabled by default in production.
THROTTLE_ENABLED=true # Enabled by default in production
THROTTLE_TTL=60000 # Default window (ms)
THROTTLE_LIMIT=100 # Default global limit
Set THROTTLE_ENABLED=false to disable (not recommended in production).
Guard Setup
@Module({
imports: [
ThrottlerModule.forRoot({
ttl: configService.get("THROTTLE_TTL"),
limit: configService.get("THROTTLE_LIMIT"),
}),
],
})
export class AppModule {}