Spaces:
Paused
Paused
| import { Module } from '@nestjs/common'; | |
| import { ConfigModule, ConfigService } from '@nestjs/config'; | |
| import { MongooseModule } from '@nestjs/mongoose'; | |
| import { ScheduleModule } from '@nestjs/schedule'; | |
| import { MailerModule } from '@nestjs-modules/mailer'; | |
| import { AppController } from './app.controller'; | |
| import { AppService } from './app.service'; | |
| import { EventsModule } from './events/events.module'; | |
| import { UsersModule } from './users/users.module'; | |
| import { AuthModule } from './auth/auth.module'; | |
| import { XIntegrationModule } from './x-integration/x-integration.module'; | |
| import { CloudinaryModule } from './cloudinary/cloudinary.module'; | |
| import { DashboardModule } from './dashboard/dashboard.module'; | |
| import { AdminModule } from './admin/admin.module'; | |
| import { NotificationsModule } from './notifications/notifications.module'; | |
| ({ | |
| imports: [ | |
| ConfigModule.forRoot({ | |
| isGlobal: true, | |
| }), | |
| MailerModule.forRootAsync({ | |
| imports: [ConfigModule], | |
| useFactory: async (configService: ConfigService) => ({ | |
| transport: { | |
| host: configService.get<string>('MAIL_HOST'), | |
| port: configService.get<number>('MAIL_PORT'), | |
| secure: false, | |
| auth: { | |
| user: configService.get<string>('MAIL_USER'), | |
| pass: configService.get<string>('MAIL_PASS'), | |
| }, | |
| }, | |
| defaults: { | |
| from: `"${configService.get<string>('MAIL_FROM_NAME')}" <${configService.get<string>('MAIL_FROM_EMAIL')}>`, | |
| }, | |
| }), | |
| inject: [ConfigService], | |
| }), | |
| MongooseModule.forRootAsync({ | |
| imports: [ConfigModule], | |
| useFactory: async (configService: ConfigService) => ({ | |
| uri: configService.get<string>('MONGO_URI'), | |
| }), | |
| inject: [ConfigService], | |
| }), | |
| ScheduleModule.forRoot(), | |
| EventsModule, | |
| UsersModule, | |
| AuthModule, | |
| XIntegrationModule, | |
| CloudinaryModule, | |
| DashboardModule, | |
| AdminModule, | |
| NotificationsModule, | |
| ], | |
| controllers: [AppController], | |
| providers: [AppService], | |
| }) | |
| export class AppModule { | |
| constructor(private configService: ConfigService) {} | |
| } | |