Add health checks

This commit is contained in:
Kieran 2022-07-23 21:58:17 +01:00
parent 034c0d3664
commit bed64ad3e1
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,7 @@ services.AddRazorPages();
services.AddRouting();
services.AddControllers()
.AddNewtonsoftJson((opt) => { ConfigJsonSettings(opt.SerializerSettings); });
services.AddHealthChecks();
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
@ -214,6 +215,8 @@ app.UseSwaggerUI();
app.UseAuthentication();
app.UseAuthorization();
app.UseHealthChecks("/healthz");
app.UseEndpoints(ep =>
{
ep.MapControllers();

View File

@ -21,6 +21,7 @@
<PackageReference Include="FluentMigrator.Runner.Postgres" Version="3.3.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.7" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="MSBuildGitHash" Version="2.0.2">
<PrivateAssets>all</PrivateAssets>