Skip to content

Instantly share code, notes, and snippets.

@jasonbyrne
Last active December 22, 2021 03:32
Show Gist options
  • Save jasonbyrne/5683dafb487086c3fd2db6278d108f32 to your computer and use it in GitHub Desktop.
Save jasonbyrne/5683dafb487086c3fd2db6278d108f32 to your computer and use it in GitHub Desktop.
NestJS Bootstrap with custom global exception filter
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { GlobalExceptionFilter } from './exception-handler';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalFilters(new GlobalExceptionFilter());
await app.listen(3000);
}
bootstrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment