67 lines
1.9 KiB
TypeScript
67 lines
1.9 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { AppController } from './app.controller';
|
|
import { AppService } from './app.service';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { RedisModule } from './redis/redis.module';
|
|
import { AuthModule } from './auth/auth.module';
|
|
import { UserModule } from './user/user.module';
|
|
import { CommonModule } from './common/common.module';
|
|
import { SharedModule } from './shared/shared.module';
|
|
import { HelpModule } from './help/help.module';
|
|
import { JwtModule } from './common/jwt/jwt.module';
|
|
import { JwtStrategy } from './common/jwt/jwt.strategy';
|
|
|
|
// 새로 생성한 모듈들
|
|
import { FarmModule } from './farm/farm.module';
|
|
import { CowModule } from './cow/cow.module';
|
|
import { GenomeModule } from './genome/genome.module';
|
|
import { MptModule } from './mpt/mpt.module';
|
|
import { DashboardModule } from './dashboard/dashboard.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
}),
|
|
TypeOrmModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
inject: [ConfigService],
|
|
useFactory: (configService: ConfigService) => ({
|
|
type: 'postgres',
|
|
host: configService.get('POSTGRES_HOST'),
|
|
port: configService.get('POSTGRES_PORT'),
|
|
username: configService.get('POSTGRES_USER'),
|
|
password: configService.get('POSTGRES_PASSWORD'),
|
|
database: configService.get('POSTGRES_DB'),
|
|
synchronize: configService.get('POSTGRES_SYNCHRONIZE'),
|
|
logging: configService.get('POSTGRES_LOGGING'),
|
|
autoLoadEntities: true,
|
|
entities: [],
|
|
}),
|
|
}),
|
|
// 인프라 모듈
|
|
RedisModule,
|
|
JwtModule,
|
|
CommonModule,
|
|
SharedModule,
|
|
|
|
// 인증/사용자 모듈
|
|
AuthModule,
|
|
UserModule,
|
|
|
|
// 비즈니스 모듈
|
|
FarmModule,
|
|
CowModule,
|
|
GenomeModule,
|
|
MptModule,
|
|
DashboardModule,
|
|
|
|
// 기타
|
|
HelpModule,
|
|
],
|
|
controllers: [AppController],
|
|
providers: [AppService, JwtStrategy],
|
|
})
|
|
export class AppModule {}
|