Open the Startup.cs file, scroll down to the Configure method, and change the following lines accordingly (the updated code is highlighted):
public void Configure(IApplicationBuilder app, IWebHostEnvironment env){ /// ...existing code... app.UseHealthChecks("/hc", new CustomHealthCheckOptions()); /// ...existing code...}
Once done, we can finally hit F5 and properly test it out. This time, we won't be disappointed by the outcome, as shown in the following screenshot:
That's a pretty nice response, isn't it?
Now, each and every check is properly documented, as well as the total outcome data, in a structured JSON ...