add TypeORM postgres config and migration runner.

This commit is contained in:
2026-10-05 20:54:50 +02:00
parent ca8233eb5a
commit 64041aa9a8
9 changed files with 1251 additions and 31 deletions
+9 -3
View File
@@ -1,13 +1,19 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import appConfig from './config';
import { ConfigModule, ConfigService, registerAs } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { getAppConfig, getPostgresConfig } from './config';
import { HealthCheckModule } from './modules/healthCheck/HealthCheckModule';
import { Config } from './types/Config';
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [appConfig]
load: [registerAs('postgres', getPostgresConfig), registerAs('app', getAppConfig)]
}),
TypeOrmModule.forRootAsync({
useFactory: (configService: ConfigService) => configService.get('postgres') as Config['postgres'],
inject: [ConfigService]
}),
HealthCheckModule
]