Пример #1
0
 function stop(){
     console.log("Server is closing...");
     mongoose.conection.close();
     server.close(function(){
         console.log("closing");
     });
 }
Пример #2
0
process.on('SIGINT', function () {
    mongoose.conection.close(function () {
        console.log("Mongoose disconnected as the application is shutting down.");
    });
});