diff --git a/AffirmationGenerator.Server/Program.cs b/AffirmationGenerator.Server/Program.cs index 2ba99fb..c795853 100644 --- a/AffirmationGenerator.Server/Program.cs +++ b/AffirmationGenerator.Server/Program.cs @@ -5,6 +5,7 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddApi().AddApplication(builder.Configuration).AddInfrastructure(builder.Configuration); +builder.Services.AddHealthChecks(); // Configure the HTTP request pipeline. var app = builder.Build(); @@ -27,6 +28,8 @@ app.MapControllers(); +app.MapHealthChecks("/health"); + app.MapFallbackToFile("/index.html"); app.Run(); diff --git a/fly.toml b/fly.toml index 3ce6ec1..8c69bec 100644 --- a/fly.toml +++ b/fly.toml @@ -16,6 +16,13 @@ primary_region = 'ams' min_machines_running = 0 processes = ['app'] +[[http_service.checks]] + grace_period = "10s" + interval = "30s" + timeout = "5s" + method = "GET" + path = "/health" + [[vm]] memory = '1gb' cpus = 1