पाठ 33 / 34
Rate Limiting
@nestjs/throttler और @Throttle decorator से अपनी API को दुरुपयोग से बचाएँ, per route या globally।
Throttle decorator
Time window में requests को limit करने के लिए @Throttle() guard का उपयोग करें।
import { Throttle } from '@nestjs/throttler';
@Throttle({ default: { limit: 10, ttl: 60000 } }) // 10 requests per minute
@Get()
findAll() { ... }