diff --git a/SharpbinV3.Server/Program.cs b/SharpbinV3.Server/Program.cs index 1b4adbf..5341d5e 100644 --- a/SharpbinV3.Server/Program.cs +++ b/SharpbinV3.Server/Program.cs @@ -30,6 +30,9 @@ namespace SharpbinV3.Server builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); + + builder.Services.AddHealthChecks() + .AddDbContextCheck("Database"); builder.Services .AddAuthentication(JwtBearerDefaults.AuthenticationScheme) @@ -105,6 +108,8 @@ namespace SharpbinV3.Server db.Database.Migrate(); } + app.MapHealthChecks("/health"); + app.Run(); } } diff --git a/SharpbinV3.Server/SharpbinV3.Server.csproj b/SharpbinV3.Server/SharpbinV3.Server.csproj index 3b043d5..edd1d2c 100644 --- a/SharpbinV3.Server/SharpbinV3.Server.csproj +++ b/SharpbinV3.Server/SharpbinV3.Server.csproj @@ -25,6 +25,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive +