From e3c85ea34a62c4b5c1e00c66d137d18af0c61097 Mon Sep 17 00:00:00 2001 From: Ryan Campbell <89273172+bigtallcampbell@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:47:29 -0500 Subject: [PATCH] Add service health endpoint (#12) * adding Health Check Service * updating to grpcHealthCheck --- src/Program.cs | 1 + test/debugClient/Program.cs | 1 + test/integrationTests/TestSharedContext.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/Program.cs b/src/Program.cs index 9d76c91..3edd33b 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -32,6 +32,7 @@ public static void Main(string[] args) { app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapGrpcService(); + endpoints.MapGrpcHealthChecksService(); endpoints.MapGet("/", async context => { await context.Response.WriteAsync("Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909"); }); diff --git a/test/debugClient/Program.cs b/test/debugClient/Program.cs index 5a1fee4..914dabf 100644 --- a/test/debugClient/Program.cs +++ b/test/debugClient/Program.cs @@ -37,6 +37,7 @@ public static void Main(string[] args) { app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapGrpcService(); + endpoints.MapGrpcHealthChecksService(); endpoints.MapGet("/", async context => { await context.Response.WriteAsync("Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909"); }); diff --git a/test/integrationTests/TestSharedContext.cs b/test/integrationTests/TestSharedContext.cs index e3f3bfa..280ffd0 100644 --- a/test/integrationTests/TestSharedContext.cs +++ b/test/integrationTests/TestSharedContext.cs @@ -51,6 +51,7 @@ public TestSharedContext() { _grpcHost.UseRouting(); _grpcHost.UseEndpoints(endpoints => { endpoints.MapGrpcService(); + endpoints.MapGrpcHealthChecksService(); endpoints.MapGet("/", async context => { await context.Response.WriteAsync("Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909"); });