function stop(){ console.log("Server is closing..."); mongoose.conection.close(); server.close(function(){ console.log("closing"); }); }
process.on('SIGINT', function () { mongoose.conection.close(function () { console.log("Mongoose disconnected as the application is shutting down."); }); });