title: Execute code on nodejs server shutdown with express
body: <p>Is there a way to execute a piece of code in Node.js Express just before the node.js process exits, regardless whether it was due to an error being thrown, or pressing Ctrl+C, or any other reason?</p>