Configuring the output message

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 ...

Get ASP.NET Core 3 and Angular 9 - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.