26 lines
802 B
TypeScript
26 lines
802 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';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot(),
|
|
TypeOrmModule.forRoot({
|
|
type: 'postgres',
|
|
host: process.env.POSTGRES_HOST,
|
|
port: 5432,
|
|
ssl: process.env.POSTGRES_SSL === 'true',
|
|
username: process.env.POSTGRES_USER,
|
|
password: process.env.POSTGRES_PASSWORD,
|
|
database: process.env.POSTGRES_DATABASE,
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
synchronize: process.env.DB_SYNC === 'true',
|
|
}),
|
|
SocketModule,
|
|
NotificationModule,
|
|
],
|
|
})
|
|
export class AppModule {}
|