42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { BullModule } from '@nestjs/bull';
|
|
import { ScheduleModule } from '@nestjs/schedule';
|
|
import { EventEmitterModule } from '@nestjs/event-emitter';
|
|
import { CacheModule } from '@nestjs/cache-manager';
|
|
import * as redisStore from 'cache-manager-redis-store';
|
|
|
|
// Import des configurations
|
|
|
|
// Import des modules
|
|
import { PrismaService } from './shared/services/prisma.service';
|
|
import { MerchantModule } from './merchant/merchant.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
//load: [],
|
|
envFilePath: ['.env.local', '.env'],
|
|
}),
|
|
|
|
CacheModule.registerAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: (configService: ConfigService) => ({
|
|
store: redisStore,
|
|
host: configService.get('app.redis.host'),
|
|
port: configService.get('app.redis.port'),
|
|
password: configService.get('app.redis.password'),
|
|
ttl: 600, // 10 minutes default
|
|
|
|
}),
|
|
inject: [ConfigService],
|
|
isGlobal: true,
|
|
}),
|
|
MerchantModule
|
|
],
|
|
providers: [PrismaService],
|
|
exports: [PrismaService],
|
|
})
|
|
export class AppModule {}
|