Skip to content

Instantly share code, notes, and snippets.

@Vatsalya-singhi
Created March 27, 2025 18:48
Show Gist options
  • Save Vatsalya-singhi/077d540ad3d120fe6ba1d5ffbf9e1a64 to your computer and use it in GitHub Desktop.
Save Vatsalya-singhi/077d540ad3d120fe6ba1d5ffbf9e1a64 to your computer and use it in GitHub Desktop.
// main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { LoggingInterceptor } from './logging.interceptor';
import { APP_INTERCEPTOR } from '@nestjs/core';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalInterceptors(new LoggingInterceptor()); // Apply globally
await app.listen(3000);
}
bootstrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment