Question · NestJS course · Module 2: Routing and Request Lifecycle

Introduction: Global ValidationPipe

How do you register ValidationPipe globally in a NestJS application?

Answer options

  • In main.ts: app.useGlobalPipes(new ValidationPipe())
  • In the package.json file
  • In the tsconfig.json file
  • In the .env file
Show the answer

Correct answer:

  • In main.ts: app.useGlobalPipes(new ValidationPipe())