-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.module.ts
45 lines (44 loc) · 1.36 KB
/
app.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Module, ValidationPipe } from '@nestjs/common';
import { PrismaModule } from './prisma/prisma.module';
import { AuthModule } from './auth/auth.module';
import { UserModule } from './user/user.module';
import { BlogModule } from './blog/blog.module';
import { SurveyModule } from './survey/survey.module';
import { TasksModule } from './tasks/tasks.module';
import { AnalyticsModule } from './analytics/analytics.module';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { CacheModule } from '@nestjs/cache-manager';
import { QuizModule } from './quiz/quiz.module';
import { APP_PIPE } from '@nestjs/core';
import { MedicalModule } from './medical/medical.module';
@Module({
imports: [
PrismaModule,
ConfigModule.forRoot({
isGlobal: true,
}),
CacheModule.registerAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => {
return {
socket: {
host: configService.get<string>('REDIS_HOST'),
port: configService.get<number>('REDIS_PORT'),
},
password: configService.get<string>('REDIS_PASSWORD'),
db: 0,
};
},
inject: [ConfigService],
}),
AuthModule,
UserModule,
BlogModule,
SurveyModule,
TasksModule,
AnalyticsModule,
QuizModule,
MedicalModule,
],
})
export class AppModule { }