import { Module } from '@nestjs/common'; import { ConfigModule as NestConfigModule } from '@nestjs/config'; import { ConfigController } from '../controllers/configController'; import { ConfigCenterService } from '../services/configCenterService'; import { ConfigValidationService } from '../services/configValidationService'; import { DynamicConfigService } from '../services/dynamicConfigService'; import { DocsNavigationController } from '../controllers/docsNavigationController'; import { appConfig } from './appConfig'; @Module({ imports: [ NestConfigModule.forRoot({ isGlobal: true, load: [() => appConfig], envFilePath: ['.env.local', '.env.development', '.env.production', '.env'], }), ], controllers: [ConfigController, DocsNavigationController], providers: [ ConfigCenterService, ConfigValidationService, DynamicConfigService, { provide: 'APP_CONFIG', useValue: appConfig, }, ], exports: [ ConfigCenterService, ConfigValidationService, DynamicConfigService, 'APP_CONFIG', ], }) export class ConfigModule {}