Skip to content

Commit

Permalink
fix: Adding generic health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoPires committed Apr 20, 2022
1 parent 7462399 commit 2f837c7
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 0 deletions.
Binary file modified src/api-gateways/DevStore.Bff.Checkout/Configuration/ApiConfig.cs
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace DevStore.WebAPI.Core.Configuration
{
public static class GenericHealthCheck
{
public static void AddGenericHealthCheck(this IServiceCollection services)
{
services.AddHealthChecks();
}

public static void UseGenericHealthCheck(this WebApplication app, string path)
{
app.MapHealthChecks(path);
}
}
}
Binary file modified src/services/DevStore.Billing.API/Configuration/ApiConfig.cs
Binary file not shown.
Binary file modified src/services/DevStore.Billing.API/Program.cs
Binary file not shown.
Binary file modified src/services/DevStore.Catalog.API/Configuration/ApiConfig.cs
Binary file not shown.
Binary file modified src/services/DevStore.Customers.API/Configuration/ApiConfig.cs
Binary file not shown.
Binary file modified src/services/DevStore.Identity.API/Configuration/ApiConfig.cs
Binary file not shown.
Binary file modified src/services/DevStore.Orders.API/Configuration/ApiConfig.cs
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using DevStore.WebAPI.Core.DatabaseFlavor;
using static DevStore.WebAPI.Core.DatabaseFlavor.ProviderConfiguration;
using DevStore.ShoppingCart.API.Data;
using DevStore.WebAPI.Core.Configuration;

namespace DevStore.ShoppingCart.API.Configuration
{
Expand All @@ -22,6 +23,8 @@ public static void AddApiConfiguration(this IServiceCollection services, IConfig
.AllowAnyMethod()
.AllowAnyHeader());
});

services.AddGenericHealthCheck();
}

public static void UseApiConfiguration(this WebApplication app, IWebHostEnvironment env)
Expand All @@ -39,6 +42,8 @@ public static void UseApiConfiguration(this WebApplication app, IWebHostEnvironm
app.UseAuthorization();

app.MapGrpcService<ShoppingCartGrpcService>().RequireCors("Total");

app.UseGenericHealthCheck("/healthz");
}
}
}
Binary file modified src/web/DevStore.WebApp.MVC/Configuration/WebAppConfig.cs
Binary file not shown.

0 comments on commit 2f837c7

Please sign in to comment.