Make app listen only after DB connection in Node
In cases while our all routes need a DB connection, and we would not want the server running, if the database connection isn’t working. Then, in such a case, we can call app.listen in the DB connection callback.