import { Module , OnModuleInit } from '@nestjs/common' ; import { RavenInterceptor , RavenModule } from 'nest-raven' ; import { APP_INTERCEPTOR } from '@nestjs/core' ; import { AppController } from './app.controller' ; import { AppService } from './app.service' ; import { SharedModule } from './shared/shared.module' ; import { HealthModule } from './health/health.module' ; import { SocketModule } from './socket/socket.module' ; const modules = [ SharedModule , HealthModule , SocketModule ] ; const providers = [ AppService ] ; if ( process . env . SENTRY_DSN ) { modules . push ( RavenModule ) ; providers . push ( { provide : APP_INTERCEPTOR , useValue : new RavenInterceptor ( ) , } ) ; } @ Module ( { imports : modules , exports : [ SocketModule ] , controllers : [ AppController ] , providers , } ) export class AppModule implements OnModuleInit { async onModuleInit ( ) { } }