feat: collections controller, healthcheck
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user