From 607df99bfb5281c4e5c26988166cf4f958469f12 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Tue, 14 Mar 2023 07:21:34 -0700 Subject: [PATCH] the health ui shows more details now (#11) --- Newsbot.Collector.Api/Newsbot.Collector.Api.csproj | 1 + Newsbot.Collector.Api/Program.cs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Newsbot.Collector.Api/Newsbot.Collector.Api.csproj b/Newsbot.Collector.Api/Newsbot.Collector.Api.csproj index 32ea9fc..0f5fc65 100644 --- a/Newsbot.Collector.Api/Newsbot.Collector.Api.csproj +++ b/Newsbot.Collector.Api/Newsbot.Collector.Api.csproj @@ -9,6 +9,7 @@ + diff --git a/Newsbot.Collector.Api/Program.cs b/Newsbot.Collector.Api/Program.cs index de8f258..5f11a88 100644 --- a/Newsbot.Collector.Api/Program.cs +++ b/Newsbot.Collector.Api/Program.cs @@ -1,5 +1,7 @@ using Hangfire; using Hangfire.MemoryStorage; +using HealthChecks.UI.Client; +using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Newsbot.Collector.Domain.Consts; using Newsbot.Collector.Domain.Models; using Newsbot.Collector.Services.Jobs; @@ -51,7 +53,11 @@ SetupRecurringJobs(config, Log.Logger); app.UseAuthorization(); -app.MapHealthChecks("/health"); +app.MapHealthChecks("/health", new HealthCheckOptions +{ + Predicate = _ => true, + ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse +}); app.MapControllers(); app.Run();