tmilar/meli-manager

Startup app services in order, exit early on failure

tmilar opened this issue · 1 comments

The db connection, and other services such as SheetsService need to start up before the express server should be able to listen for requests.


This is a must have connection for the app, you should try this connection before setting up the express server, otherwise you're running a server and executing more code in vane since you already know that there's a critical error. Also show a more friendly error, a simple process.exit(1) just sucks

Originally posted by @fmiras in https://github.com/tmilar/meli-manager/pull/40/files/ded8c9013e1ce09734cd0ddac85d435d5e7060fa