Created
January 5, 2024 06:13
-
-
Save centralizer/139552a11df0e8817e243ada1eef7b41 to your computer and use it in GitHub Desktop.
Bull Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BullModule } from "@nestjs/bull"; | |
import { Module } from "@nestjs/common"; | |
import { ConfigModule, ConfigService } from "@nestjs/config"; | |
import { APP_INTERCEPTOR } from "@nestjs/core"; | |
import { ResponseInterceptor } from "@common/interceptors/response-interceptor"; | |
import { AppController } from "./app.controller"; | |
import { AppService } from "./app.service"; | |
// modules | |
import { AuthModule } from "./auth/auth.module"; | |
import { CategoriesModule } from "./categories/categories.module"; | |
import { CommentsModule } from "./comments/comments.module"; | |
import { CommonModule } from "./common/common.module"; | |
import { DatabaseModule } from "./database/database.module"; | |
import { LinksModule } from "./links/links.module"; | |
import { MailModule } from "./mail/mail.module"; | |
import { MediaModule } from "./medias/medias.module"; | |
import { NotesModule } from "./notes/notes.module"; | |
import { NotificationsModule } from "./notifications/notifications.module"; | |
import { SharedModule } from "./shared/shared.module"; | |
import { StickysModule } from "./stickys/stickys.module"; | |
import { TranscriptsModule } from "./transcripts/transcripts.module"; | |
import { UsersModule } from "./users/users.module"; | |
import { YoutubModule } from "./youtube/youtube.module"; | |
@Module({ | |
imports: [ | |
ConfigModule.forRoot({ | |
isGlobal: true, | |
envFilePath: `.env.${process.env.NODE_ENV}`, | |
}), | |
BullModule.forRootAsync({ | |
imports: [ConfigModule], | |
inject: [ConfigService], | |
useFactory: async (configService: ConfigService) => ({ | |
redis: { | |
host: configService.get("REDIS_HOST"), | |
port: configService.get("REDIS_PORT"), | |
username: configService.get("REDIS_USER"), | |
password: configService.get("REDIS_PASSWORD"), | |
}, | |
}), | |
}), | |
AuthModule, | |
CommentsModule, | |
DatabaseModule, | |
CategoriesModule, | |
MediaModule, | |
NotesModule, | |
CommonModule, | |
UsersModule, | |
YoutubModule, | |
MailModule, | |
StickysModule, | |
LinksModule, | |
SharedModule, | |
TranscriptsModule, | |
NotificationsModule, | |
], | |
controllers: [AppController], | |
providers: [ | |
AppService, | |
{ | |
provide: APP_INTERCEPTOR, | |
useClass: ResponseInterceptor, | |
}, | |
], | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment