node.js - Restart current instance using NodeJS -
i'd restart application inside application using nodejs , npm.
it doesn't work child_process
:
var exec = require('child_process').exec; exec('npm restart', function(error, stdout, stderr) { console.log('stdout: ' + stdout); console.log('stderr: ' + stderr); if (error !== null) { console.log('exec error: ' + error); } });
if master process died, there no way reanimate him himself.
have @ nodemon restart script.
Comments
Post a Comment