fix(api): remove duplicate /healthz and /readyz minimal API routes

HealthController already exposes [HttpGet("/healthz")]
and [HttpGet("/readyz")]. The duplicate MapGet in Program.cs
caused AmbiguousMatchException on every /healthz request.
This commit is contained in:
Arnaud Dartois committed 2026-07-21 07:54:15 +00:00
1 parent c92ee47eb7
commit 2e4918c9d7
1 file changed
-19
-19
View File
@@ -282,25 +282,6 @@ app.UseCors(options =>
app.UseRateLimiter();
// ── Health check endpoints for Docker ─────────────────────────────
app.MapGet("/healthz", () =>
Results.Ok(new { status = "healthy", timestamp = DateTime.UtcNow }));
app.MapGet("/readyz", async (HttpContext context) =>
{
try
{
using var scope = context.RequestServices.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
_ = await db.Database.CanConnectAsync();
return Results.Ok(new { status = "healthy", timestamp = DateTime.UtcNow });
}
catch
{
return Results.StatusCode(503);
}
});
// ── Cookie auth endpoints (called from Blazor via JS fetch) ───────
// /_auth/signin — Validates the JWT access token and creates an auth cookie
// /_auth/signout — Clears the authentication cookie on logout