`csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
//services.AddInMemoryStorage();
services.AddHealthChecksUI()
.AddHealthChecks()
.AddCheck<DummyCheck>("Dummy Checku");
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseMvc();
app.UseHealthChecks("/healthz", new HealthCheckOptions()
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
app.UseHealthChecksUI(s =>
{
s.UIPath = "/show-health-ui"; // this is ui path in your browser
s.ApiPath = "/health-ui-api"; // the UI ( spa app ) use this path to get information from the store ( this is NOT the healthz path, is internal ui api )
});
}`
.net core 2.2
`csharp public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);