From eae66518c86c097929f6178929ae21d1ca0ec218 Mon Sep 17 00:00:00 2001 From: Beau Findlay Date: Sat, 31 Jan 2026 22:03:27 +0000 Subject: [PATCH] Add health probe endpoint --- src/BlazorApp/Program.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/BlazorApp/Program.cs b/src/BlazorApp/Program.cs index 162930b..45d3f56 100644 --- a/src/BlazorApp/Program.cs +++ b/src/BlazorApp/Program.cs @@ -2,16 +2,19 @@ using BlazorApp.Components; var builder = WebApplication.CreateBuilder(args); -// Add services to the container. builder.Services.AddRazorComponents(); var app = builder.Build(); -// Configure the HTTP request pipeline. +app.MapGet("/health", () => Results.Ok(new +{ + status = "healthy", + timestamp = DateTime.UtcNow +})); + if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error", true); - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); }