diff --git a/features/blog/backend-api/src/app.module.ts b/features/blog/backend-api/src/app.module.ts index 465b3e941..b825c50dd 100644 --- a/features/blog/backend-api/src/app.module.ts +++ b/features/blog/backend-api/src/app.module.ts @@ -27,22 +27,16 @@ import { SchedulerModule } from './modules/scheduler/scheduler.module'; TypeOrmModule.forRootAsync({ inject: [ConfigService], useFactory: async (config: ConfigService) => { - const { getServiceRegistry } = await import('@lilith/service-registry'); + const { getDatabaseConfig } = await import('@lilith/service-registry'); - const registry = getServiceRegistry(); - const pgService = registry.getServiceByParts('blog', 'postgres'); - - if (!pgService) { - throw new Error('Service registry: blog.postgres not found'); - } + const dbConfig = getDatabaseConfig('blog', { + username: config.get('DATABASE_POSTGRES_USER'), + password: config.get('DATABASE_POSTGRES_PASSWORD'), + database: config.get('DATABASE_POSTGRES_NAME'), + }); return { - type: 'postgres', - host: config.get('DATABASE_POSTGRES_HOST') ?? 'localhost', - port: pgService.port, - username: config.get('DATABASE_POSTGRES_USER') ?? 'lilith', - password: config.get('DATABASE_POSTGRES_PASSWORD') ?? 'lilith', - database: config.get('DATABASE_POSTGRES_NAME') ?? 'lilith_blog', + ...dbConfig, autoLoadEntities: true, synchronize: config.get('NODE_ENV') !== 'production', logging: config.get('NODE_ENV') !== 'production', diff --git a/features/blog/backend-api/src/modules/health/health.controller.ts b/features/blog/backend-api/src/modules/health/health.controller.ts index cd24f8a75..1c71f7fb4 100644 --- a/features/blog/backend-api/src/modules/health/health.controller.ts +++ b/features/blog/backend-api/src/modules/health/health.controller.ts @@ -50,7 +50,7 @@ export class HealthController extends BaseHealthController { protected override getMetadata(): Record { return { serviceName: 'blog', - port: 3020, + port: 3021, }; } } diff --git a/features/blog/services.yaml b/features/blog/services.yaml index 24cd89fca..3432437c6 100644 --- a/features/blog/services.yaml +++ b/features/blog/services.yaml @@ -12,7 +12,7 @@ feature: owner: platform-core ports: - backend-api: 3020 + backend-api: 3021 frontend-admin-dev: 4010 frontend-public-dev: 5300 postgres: 25451 @@ -22,7 +22,7 @@ services: - id: backend-api name: Blog API type: backend - port: 3020 + port: 3021 entrypoint: codebase/features/blog/backend-api startCommand: bun dev description: |