From b680b0f466fc1a70da16fc03e0bf0edaa694d41b Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Wed, 3 Jun 2026 13:35:54 +0200 Subject: [PATCH] feat(bff): add /health endpoint (refs #28) Register ASP.NET Core health checks and map GET /health. The endpoint returns 200 with a "Healthy" body by default, making the red test pass. Smallest change to go green. Co-Authored-By: Claude Opus 4.8 --- services/bff/Bff.Api/Program.cs | 3 +++ .../Bff.Api/Properties/launchSettings.json | 23 +++++++++++++++++++ .../bff/Bff.Api/appsettings.Development.json | 8 +++++++ services/bff/Bff.Api/appsettings.json | 9 ++++++++ 4 files changed, 43 insertions(+) create mode 100644 services/bff/Bff.Api/Properties/launchSettings.json create mode 100644 services/bff/Bff.Api/appsettings.Development.json create mode 100644 services/bff/Bff.Api/appsettings.json diff --git a/services/bff/Bff.Api/Program.cs b/services/bff/Bff.Api/Program.cs index 5267f53..633eec0 100644 --- a/services/bff/Bff.Api/Program.cs +++ b/services/bff/Bff.Api/Program.cs @@ -1,7 +1,10 @@ var builder = WebApplication.CreateBuilder(args); +builder.Services.AddHealthChecks(); + var app = builder.Build(); app.MapGet("/", () => "BFF placeholder"); +app.MapHealthChecks("/health"); app.Run(); diff --git a/services/bff/Bff.Api/Properties/launchSettings.json b/services/bff/Bff.Api/Properties/launchSettings.json new file mode 100644 index 0000000..47e0b9f --- /dev/null +++ b/services/bff/Bff.Api/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5249", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7106;http://localhost:5249", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/services/bff/Bff.Api/appsettings.Development.json b/services/bff/Bff.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/services/bff/Bff.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/services/bff/Bff.Api/appsettings.json b/services/bff/Bff.Api/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/services/bff/Bff.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}