Browse Source

shepherd pm2 api

ca333-dev
ca333 8 years ago
parent
commit
68d31e5e42
  1. 14
      routes/shepherd.js

14
routes/shepherd.js

@ -84,13 +84,13 @@ shepherd.post('/herdlist', function(req, res) {
//console.log(req.body.herd); //console.log(req.body.herd);
//console.log(req.body.options); //console.log(req.body.options);
pm2.connect(true,function(err) { pm2.connect(true, function(err) {
pm2.describe('IGUANA', function(err, list){ if (err) throw err; //todo: proper error handling
console.log(list[0]); pm2.describe("IGUANA", function(err, list) {
for(var i = 0, l = list.length - 1; i < l; i++) { pm2.disconnect(); //disconnect after getting proc info list
console.log(list[i].pm2_env.status); if (err) throw err //todo: proper error handling
} console.log(list[0].pm2_env.status) //print status of IGUANA proc
}); });
}); });
res.end('{"msg": "success","result": "result"}'); res.end('{"msg": "success","result": "result"}');

Loading…
Cancel
Save