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:
1 parent
c92ee47eb7
commit
2e4918c9d7
1 file changed
-19
@@ -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
|
||||
|
||||
Reference in new issue
Block a user