feat: collections controller, healthcheck

This commit is contained in:
2026-09-28 02:18:57 +04:00
parent 5ca59a6ad8
commit 5238bfd103
11 changed files with 273 additions and 1 deletions
+7 -1
View File
@@ -5,6 +5,8 @@ using MemeVault.Api.Options;
using MemeVault.Infrastructure;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
using MemeVault.Infrastructure.Persistence;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Prometheus;
var builder = WebApplication.CreateBuilder(args);
@@ -53,6 +55,10 @@ builder.Services.AddExceptionHandler<DomainExceptionHandler>();
builder.Services.AddAuthorization();
builder.Services.AddControllers();
// ── OpenAPI ───────────────────────────────────────────────────────────────────
builder.Services.AddHealthChecks()
.AddDbContextCheck<AppDbContext>("postgres");
// ── OpenAPI ───────────────────────────────────────────────────────────────────
builder.Services.AddEndpointsApiExplorer();
@@ -63,7 +69,7 @@ app.UseHttpMetrics();
app.UseAuthentication();
app.UseAuthorization();
app.MapGet("/health", () => Results.Ok(new { status = "ok" }));
app.MapHealthChecks("/health");
app.MapControllers();
app.MapMetrics();