-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathapp.module.ts
More file actions
51 lines (50 loc) · 1.39 KB
/
app.module.ts
File metadata and controls
51 lines (50 loc) · 1.39 KB
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
46
47
48
49
50
51
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { ServerFeatureAuthModule } from '@fst/server/feature-auth';
import { ServerFeatureAuthGoogleModule } from '@fst/server/feature-auth-google';
import { ServerFeatureHealthModule } from '@fst/server/feature-health';
import { ServerFeatureTodoModule } from '@fst/server/feature-todo';
import { ServerFeatureUserModule } from '@fst/server/feature-user';
import {
DatabaseExceptionFilter,
JwtAuthGuard,
TypeormConfigService,
appConfig,
dbConfig,
googleConfig,
validationSchema,
} from '@fst/server/util';
import { APP_FILTER, APP_GUARD } from '@nestjs/core';
import { TypeOrmModule } from '@nestjs/typeorm';
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: ['.env'],
ignoreEnvVars: true,
validationSchema,
load: [appConfig, dbConfig, googleConfig],
}),
TypeOrmModule.forRootAsync({
useClass: TypeormConfigService,
inject: [ConfigService],
}),
ServerFeatureTodoModule,
ServerFeatureHealthModule,
ServerFeatureAuthModule,
ServerFeatureUserModule,
ServerFeatureAuthGoogleModule,
],
controllers: [],
providers: [
{
provide: APP_GUARD,
useClass: JwtAuthGuard,
},
{
provide: APP_FILTER,
useClass: DatabaseExceptionFilter,
},
],
})
export class AppModule {}