using HealthChecks.UI.Client; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using {{pascalCase PROJECT_NAME}}.Database; namespace {{pascalCase PROJECT_NAME}}.Extensions { public static class HealthChecksExtensions { public static IServiceCollection AddHealthChecksConfiguration(this IServiceCollection services) { services.AddHealthChecks() .AddDbContextCheck(); return services; } public static IEndpointRouteBuilder UseHealthChecks(this IEndpointRouteBuilder app) { app.MapHealthChecks("health", new HealthCheckOptions { ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse }); return app; } } }