O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom health module 

Sometimes, adding new modules to the application causes the application to go out of order. We need custom health modules to actually keep watch on the service and alert us that the service is out of order (service discovery does exactly this, which we will look at in Chapter 6, Service Registry and Discovery). We will be using express-ping (https://www.npmjs.com/package/express-ping) to find out the health of our node. By introducing this module in our middleware, we can expose a simple API that will tell us about its internal health to both operators and other applications.

Salient features of express-ping are as follows:

  • It is a zero configuration module, where just injecting this in the middleware will expose a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required