28 lines
874 B
TypeScript
28 lines
874 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { SocketModule } from './socket/socket.module';
|
|
import { NotificationModule } from './notifications/notification.module';
|
|
import { RedisModule } from './redis/redis.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot(),
|
|
TypeOrmModule.forRoot({
|
|
type: 'postgres',
|
|
host: process.env.DB_HOST,
|
|
port: parseInt(process.env.DB_PORT, 10),
|
|
ssl: process.env.DB_SSL === 'true',
|
|
username: process.env.DB_USERNAME,
|
|
password: process.env.DB_PASSWORD,
|
|
database: process.env.DB_DATABASE,
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
synchronize: process.env.DB_SYNC === 'true',
|
|
}),
|
|
RedisModule,
|
|
SocketModule,
|
|
NotificationModule,
|
|
],
|
|
})
|
|
export class AppModule {}
|