There has been lots of questions asking: how do we exit and what exactly does it do in node js: by using the process.exit()
command. But when and why would you need to exit?
How I understand this currently is node/nodemon app.js
starts up a process with the server in which our website runs. So when and why would we
ever need to shut it down in production?
I came across this after seeing how to close MongdoDB connection on this SO article(accepted answer, comment section): Mongoose Close Connection