1
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { TelemetryModule } from './telemetry/telemetry.module';
|
||||
import { MapsModule } from './maps/maps.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
}),
|
||||
TypeOrmModule.forRootAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
useFactory: (config: ConfigService) => ({
|
||||
type: 'postgres',
|
||||
url: config.get('DATABASE_URL'),
|
||||
autoLoadEntities: true,
|
||||
synchronize: true, // Only for prototype! Use migrations for production.
|
||||
// synchronize: true, // للمعاينة فقط؛ يفضل استخدام migrations للإنتاج
|
||||
}),
|
||||
}),
|
||||
TelemetryModule,
|
||||
MapsModule,
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
Reference in New Issue
Block a user