chore(src): 🔧 Update health controller logic and services configuration in health.controller.ts and services.yaml
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
282a06ca14
commit
fa4a4c3757
3 changed files with 10 additions and 16 deletions
|
|
@ -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<string>('DATABASE_POSTGRES_HOST') ?? 'localhost',
|
||||
port: pgService.port,
|
||||
username: config.get<string>('DATABASE_POSTGRES_USER') ?? 'lilith',
|
||||
password: config.get<string>('DATABASE_POSTGRES_PASSWORD') ?? 'lilith',
|
||||
database: config.get<string>('DATABASE_POSTGRES_NAME') ?? 'lilith_blog',
|
||||
...dbConfig,
|
||||
autoLoadEntities: true,
|
||||
synchronize: config.get('NODE_ENV') !== 'production',
|
||||
logging: config.get('NODE_ENV') !== 'production',
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export class HealthController extends BaseHealthController {
|
|||
protected override getMetadata(): Record<string, unknown> {
|
||||
return {
|
||||
serviceName: 'blog',
|
||||
port: 3020,
|
||||
port: 3021,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue