From the course: Cloud Native Development with Node.js, Docker, and Kubernetes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add a readiness check

Add a readiness check

From the course: Cloud Native Development with Node.js, Docker, and Kubernetes

Start my 1-month free trial

Add a readiness check

- [Instructor] In the previous video, we saw how to add a liveness endpoint to our application using the CloudNative Health Connect module. To do that, we created a health checker, we registered a ping check with it, to check whether we had network connectivity and could reach example.com, and then we registered that on /live. Next, we're going to add a readiness endpoint. The process for this is very, very similar. We can use the same health checker, as previously, and we can now use that to register a readiness endpoint, rather than a liveness endpoint. The single additional line now gives us a readiness endpoint, as well. Let's save our application and go to the terminal to run it. Let's first make sure we're in the myapp project directory. Do an npm install to make sure that everything is installed, and then we'll use an npm-start, to start our application. We can now go to our browser to see the state of our application. If we rerun our liveness endpoint, we still have the same…

Contents