I have an application that initially creates configuration files static(once) and after the files have been written, I need to reinitialize / restart the application. Is there something to restart the node.js application on my own?
This is necessary, because I have an application running in two runlevelsto node.js . The initial completion is completed synchronus, and after this level has been completed, the application is in the asynchronous run level in a previously running environment.
I know there are tools like nodemon, but that is not what I need in my case.
I tried to kill the application through process.kill(), which works, but I can not listen to the kill event:
process.on('exit', function(code) {
console.log('About to exit with code:', code);
});
process.kill();
Or is there a better, cleaner way to handle this?
source
share