Merge branch 'improveHealth' into 'main'
extract health to module See merge request v3/service/auth!29
This commit is contained in:
commit
ab7f73bc6a
|
@ -4,6 +4,7 @@ import { Module } from '@nestjs/common';
|
|||
import { ConfigModule } from '@nestjs/config';
|
||||
import { AuthenticationModule } from './modules/authentication/authentication.module';
|
||||
import { AuthorizationModule } from './modules/authorization/authorization.module';
|
||||
import { HealthModule } from './modules/health/health.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
@ -11,6 +12,7 @@ import { AuthorizationModule } from './modules/authorization/authorization.modul
|
|||
AutomapperModule.forRoot({ strategyInitializer: classes() }),
|
||||
AuthenticationModule,
|
||||
AuthorizationModule,
|
||||
HealthModule,
|
||||
],
|
||||
controllers: [],
|
||||
providers: [],
|
||||
|
|
|
@ -9,7 +9,7 @@ async function bootstrap() {
|
|||
{
|
||||
transport: Transport.GRPC,
|
||||
options: {
|
||||
package: ['authentication', 'authorization'],
|
||||
package: ['authentication', 'authorization', 'health'],
|
||||
protoPath: [
|
||||
join(
|
||||
__dirname,
|
||||
|
@ -19,6 +19,7 @@ async function bootstrap() {
|
|||
__dirname,
|
||||
'modules/authorization/adapters/primaries/authorization.proto',
|
||||
),
|
||||
join(__dirname, 'modules/health/adapters/primaries/health.proto'),
|
||||
],
|
||||
url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT,
|
||||
loader: { keepCase: true, enums: String },
|
||||
|
|
|
@ -40,20 +40,3 @@ message Uuid {
|
|||
}
|
||||
|
||||
message Empty {}
|
||||
|
||||
service Health {
|
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
|
||||
}
|
||||
|
||||
message HealthCheckRequest {
|
||||
string service = 1;
|
||||
}
|
||||
|
||||
message HealthCheckResponse {
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0;
|
||||
SERVING = 1;
|
||||
NOT_SERVING = 2;
|
||||
}
|
||||
ServingStatus status = 1;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import { RabbitMQModule } from '@golevelup/nestjs-rabbitmq';
|
|||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { AuthenticationMessagerController } from './adapters/primaries/authentication-messager.controller';
|
||||
import { Messager } from './adapters/secondaries/messager';
|
||||
import { HealthController } from './adapters/primaries/health.controller';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
@ -48,11 +47,7 @@ import { HealthController } from './adapters/primaries/health.controller';
|
|||
inject: [ConfigService],
|
||||
}),
|
||||
],
|
||||
controllers: [
|
||||
AuthenticationController,
|
||||
AuthenticationMessagerController,
|
||||
HealthController,
|
||||
],
|
||||
controllers: [AuthenticationController, AuthenticationMessagerController],
|
||||
providers: [
|
||||
AuthenticationProfile,
|
||||
UsernameProfile,
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package health;
|
||||
|
||||
|
||||
service Health {
|
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
|
||||
}
|
||||
|
||||
message HealthCheckRequest {
|
||||
string service = 1;
|
||||
}
|
||||
|
||||
message HealthCheckResponse {
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0;
|
||||
SERVING = 1;
|
||||
NOT_SERVING = 2;
|
||||
}
|
||||
ServingStatus status = 1;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { HealthController } from './adapters/primaries/health.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [HealthController],
|
||||
})
|
||||
export class HealthModule {}
|
Loading…
Reference in New Issue