security: add @nestjs/throttler — rate limiting global 60/min + search 20/min

This commit is contained in:
2026-04-05 07:51:05 +02:00
parent 7b7f2ac8e7
commit d3e9dc61a5
4 changed files with 21 additions and 0 deletions

View File

@@ -1,10 +1,12 @@
import { Controller, Get, Query } from '@nestjs/common';
import { Throttle } from '@nestjs/throttler';
import { WorkService } from './work.service';
@Controller('api/works')
export class WorkController {
constructor(private readonly workService: WorkService) {}
@Throttle([{ ttl: 60000, limit: 20 }])
@Get('search')
async search(
@Query('q') query: string,