Skip to content

Instantly share code, notes, and snippets.

@DillonMemo
Last active February 16, 2021 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DillonMemo/a8ec34b2b43d3733edb141da776addcc to your computer and use it in GitHub Desktop.
Save DillonMemo/a8ec34b2b43d3733edb141da776addcc to your computer and use it in GitHub Desktop.
set NestJS global scoped pipes
NestJS
  ├─src
  │  ├─users  
  │  │  ├─users.module.ts  
  │  │  └─users.resolver.ts
  │  ├─app.module.ts
  │  └─main.ts
  ├─test
  │  └─...test files
  └─eslint,env,prettier etc config files
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe());
await app.listen(3000);
}
bootstrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment