28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
import { APP_FILTER, APP_INTERCEPTOR, APP_GUARD } from '@nestjs/core';
|
|
import { ApiModule } from './api/api.module';
|
|
import { InfrastructureModule } from './infrastructure/infrastructure.module';
|
|
import { ApplicationModule } from './application/application.module';
|
|
import { GlobalExceptionFilter } from './shared/filters/global-exception.filter';
|
|
import { TransformInterceptor } from './shared/interceptors/transform.interceptor';
|
|
import { AdminAuthGuard } from './shared/guards/admin-auth.guard';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
envFilePath: [`.env.${process.env.NODE_ENV || 'development'}`, '.env'],
|
|
}),
|
|
InfrastructureModule,
|
|
ApplicationModule,
|
|
ApiModule,
|
|
],
|
|
providers: [
|
|
{ provide: APP_FILTER, useClass: GlobalExceptionFilter },
|
|
{ provide: APP_INTERCEPTOR, useClass: TransformInterceptor },
|
|
{ provide: APP_GUARD, useClass: AdminAuthGuard },
|
|
],
|
|
})
|
|
export class AppModule {}
|