chore: first
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import { MikroOrmModule } from "@mikro-orm/nestjs";
|
||||
import { FastifyMulterModule } from "@nest-lab/fastify-multer";
|
||||
import { HttpModule } from "@nestjs/axios";
|
||||
import { BullModule } from "@nestjs/bullmq";
|
||||
import { CacheModule } from "@nestjs/cache-manager";
|
||||
import { MiddlewareConsumer, Module, NestModule } from "@nestjs/common";
|
||||
import { ConfigModule } from "@nestjs/config";
|
||||
import { ThrottlerModule } from "@nestjs/throttler";
|
||||
import { MailerModule } from "@nestjs-modules/mailer";
|
||||
|
||||
import { bullMqConfig } from "./configs/bullmq.config";
|
||||
import { cacheConfig } from "./configs/cache.config";
|
||||
import { mailerConfig } from "./configs/mailer.config";
|
||||
import { databaseConfig } from "./configs/mikro-orm.config";
|
||||
import { rateLimitConfig } from "./configs/rateLimit.config";
|
||||
import { HTTPLogger } from "./core/middlewares/logger.middleware";
|
||||
import { AuthModule } from "./modules/auth/auth.module";
|
||||
import { NotificationModule } from "./modules/notifications/notifications.module";
|
||||
import { UsersModule } from "./modules/users/users.module";
|
||||
import { UtilsModule } from "./modules/utils/utils.module";
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({ isGlobal: true, cache: true }),
|
||||
MikroOrmModule.forRootAsync(databaseConfig),
|
||||
BullModule.forRootAsync(bullMqConfig()),
|
||||
MailerModule.forRootAsync(mailerConfig()),
|
||||
ThrottlerModule.forRootAsync(rateLimitConfig()),
|
||||
CacheModule.registerAsync(cacheConfig()),
|
||||
HttpModule.register({ global: true, timeout: 10000, headers: { "Content-Type": "application/json" } }),
|
||||
FastifyMulterModule.register({
|
||||
limits: {
|
||||
fileSize: 10 * 1024 * 1024,
|
||||
fieldNameSize: 200,
|
||||
fieldSize: 10 * 1024 * 1024,
|
||||
fields: 10,
|
||||
parts: 10,
|
||||
},
|
||||
}),
|
||||
AuthModule,
|
||||
UsersModule,
|
||||
NotificationModule,
|
||||
UtilsModule,
|
||||
],
|
||||
})
|
||||
export class AppModule implements NestModule {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer.apply(HTTPLogger).forRoutes("*");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user