-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.module.ts
More file actions
41 lines (39 loc) · 1.51 KB
/
app.module.ts
File metadata and controls
41 lines (39 loc) · 1.51 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
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config'
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './user/user.module';
import { TypeOrmModule } from '@nestjs/typeorm'
import { JwtModule } from '@nestjs/jwt';
import { KakaoauthService } from './kakaoauth/kakaoauth.service';
import { HttpModule } from '@nestjs/axios';
import { MbtiService } from './mbti/mbti.service';
import { CharacterService } from './character/character.service';
import { CharacterModule } from './character/character.module';
import { User } from './user/entities/user.entity';
import { Character } from './character/entities/character.entity';
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: [`config/env/.env.local`,],
}),
TypeOrmModule.forRoot({
type: 'mysql',
host: process.env.DATABASE_HOST,
port: parseInt(process.env.DATABASE_PORT),
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
entities: [__dirname + '/**/*.entity{.ts,.js}'],
synchronize: process.env.DATABASE_SYNCHRONIZE != 'false',
}),
TypeOrmModule.forFeature([User, Character]),
HttpModule.register({ timeout: 5000, maxRedirects: 5 }),
CharacterModule,
UserModule,
],
controllers: [AppController],
providers: [AppService, KakaoauthService, MbtiService, CharacterService],
})
export class AppModule { }