From adfd07c7a0c3fc68c1748a842ccc214d702ff96f Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 17 Oct 2023 14:35:38 +0200 Subject: [PATCH] use better constants --- src/app.constants.ts | 3 ++- src/main.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app.constants.ts b/src/app.constants.ts index 55408e4..bcf3f6a 100644 --- a/src/app.constants.ts +++ b/src/app.constants.ts @@ -2,6 +2,7 @@ export const SERVICE_NAME = 'user'; // grpc +export const GRPC_PACKAGE_NAME = 'user'; export const GRPC_SERVICE_NAME = 'UserService'; // configuration @@ -11,6 +12,6 @@ export const SERVICE_CONFIGURATION_PROPAGATE_QUEUE = 'user-configuration-propagate'; // health -export const HEALTH_SERVICE_NAME = 'health'; +export const GRPC_HEALTH_PACKAGE_NAME = 'health'; export const HEALTH_USER_REPOSITORY = 'UserRepository'; export const HEALTH_CRITICAL_LOGGING_KEY = 'logging.user.health.crit'; diff --git a/src/main.ts b/src/main.ts index 41728ef..1707796 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,7 @@ import { NestFactory } from '@nestjs/core'; import { MicroserviceOptions, Transport } from '@nestjs/microservices'; import { join } from 'path'; import { AppModule } from './app.module'; -import { HEALTH_SERVICE_NAME, SERVICE_NAME } from './app.constants'; +import { GRPC_HEALTH_PACKAGE_NAME, GRPC_PACKAGE_NAME } from './app.constants'; async function bootstrap() { const app = await NestFactory.create(AppModule); @@ -12,7 +12,7 @@ async function bootstrap() { app.connectMicroservice({ transport: Transport.GRPC, options: { - package: [SERVICE_NAME, HEALTH_SERVICE_NAME], + package: [GRPC_PACKAGE_NAME, GRPC_HEALTH_PACKAGE_NAME], protoPath: [ join(__dirname, 'modules/user/interface/grpc-controllers/user.proto'), join(__dirname, 'health.proto'),