Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app = moduleFixture.createNestApplication();
- app.useGlobalFilters(new EntityNotFoundExceptionFilter());
- // ensure that the requests contain valid data
- app.useGlobalPipes(
- new ValidationPipe({
- transform: true,
- // Strip data of properties without decorators
- whitelist: true,
- // Throw an error if non-whitelisted values are provided
- forbidNonWhitelisted: true,
- // Throw an error if unknown values are provided
- forbidUnknownValues: true,
- })
- );
- await app.init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement