mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 08:32:54 +00:00
20 lines
613 B
TypeScript
20 lines
613 B
TypeScript
import { Module } from "@nestjs/common";
|
|
import { ConfigModule, ConfigService } from "@nestjs/config";
|
|
import { TypeOrmModule, TypeOrmModuleOptions } from "@nestjs/typeorm";
|
|
|
|
import databaseConfig from "./config/database.config";
|
|
import { GpsModule } from "./gps/gps.module";
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({ isGlobal: true, load: [databaseConfig] }),
|
|
TypeOrmModule.forRootAsync({
|
|
inject: [ConfigService],
|
|
useFactory: (config: ConfigService): TypeOrmModuleOptions =>
|
|
config.get<TypeOrmModuleOptions>("database")!,
|
|
}),
|
|
GpsModule,
|
|
],
|
|
})
|
|
export class AppModule {}
|