-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.module.ts
26 lines (25 loc) · 911 Bytes
/
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
import {CommonModule} from "@common/common.module";
import {ApiConfigService} from "@common/api-config.service";
import {Reminder} from "@entity/reminder.entity";
import {Module} from "@nestjs/common";
import {TypeOrmModule} from "@nestjs/typeorm";
import {ReminderModule} from "@reminder/reminder.module";
import {EventModule} from "@event/event.module";
@Module({
imports: [TypeOrmModule.forRootAsync({
useFactory: (config: ApiConfigService) => ({
type: 'postgres',
username: config.dbUser,
database: config.dbName,
password: config.dbPassword,
host: config.dbHost,
entities: [Reminder],
logging: !config.isProduction,
synchronize: true,
}),
imports: [CommonModule],
inject: [ApiConfigService]
}), CommonModule, ReminderModule, EventModule],
})
export class AppModule {
}