From d4a9519cbfb8d8f945e062b147dc4703c6d09262 Mon Sep 17 00:00:00 2001 From: Avnyr Date: Tue, 27 Feb 2024 16:46:11 +0100 Subject: [PATCH] feat: :sparkles: useGlobalValidationPipe with whitelist --- src/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.ts b/src/main.ts index dbd2632..90d3aaf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,14 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; +import { ValidationPipe } from "@nestjs/common"; async function bootstrap() { const app = await NestFactory.create(AppModule); + app.useGlobalPipes( + new ValidationPipe({ + whitelist: true, + }), + ); await app.listen(3333); } bootstrap();