Implementing SignalR
Let’s briefly recap how our HealthCheck
and HealthCheckAPI
projects currently work:
- The
HealthCheck
Angular app features a component—theHealthCheckComponent
—that, right after being loaded, performs a call to the server-side/health
endpoint. - The above endpoint is handled by the
HealthCheckMiddleware
: when called, theHealthCheckAPI
ASP.NET Core Web API is configured to launch various ICMP health checks, each one configured to ping a hostname or IP address and return its status (healthy or unhealthy). - The health checks’ statuses are wrapped together by the
HealthCheckMiddleware
and sent in a single JSON response. - The
HealthCheck
Angular app fetches the JSON response and uses it to create an HTML table, thus showing the result in a readable format.
As we can see, the only interaction between the two projects is a single HTTP call issued to the /health
endpoint: right after the first health check...