mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: add health checks for database connectivity
This commit is contained in:
@@ -30,6 +30,9 @@ namespace SharpbinV3.Server
|
||||
builder.Services.AddScoped<IUserService, UserService>();
|
||||
builder.Services.AddScoped<IAuthService, AuthService>();
|
||||
builder.Services.AddScoped<IPasteService, PasteService>();
|
||||
|
||||
builder.Services.AddHealthChecks()
|
||||
.AddDbContextCheck<AppDbContext>("Database");
|
||||
|
||||
builder.Services
|
||||
.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
@@ -105,6 +108,8 @@ namespace SharpbinV3.Server
|
||||
db.Database.Migrate();
|
||||
}
|
||||
|
||||
app.MapHealthChecks("/health");
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user