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

PM2 process manager

Node.js is single threaded, meaning any use of a JavaScript throw statement will raise an exception that must be handled using the try...catch statements. Otherwise, the Node.js process will exit immediately, making it unavailable to process any further requests. As Node.js runs on single process uncaught exceptions, it needs to be handled carefully. If not, it will crash and bring down the whole application. So, the golden rule in Node.js is if any exception bubbles out to the top without being handled, our application dies.

PM2 is a process manager designed to keep our service alive forever. It is a production process manager with a built-in load balancer and is the perfect candidate for microservices. PM2 comes in quite ...

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