From: Oscar J. Rodriguez B Date: Thu, 3 Oct 2019 20:29:18 +0000 (-0400) Subject: changed ths script to spawn in the index.js X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=commitdiff_plain;h=dbf58d4a68b7e47ead6f07d5cbfaf0cc9c91eb53 changed ths script to spawn in the index.js --- diff --git a/src/routes/index.js b/src/routes/index.js index 3e06433..7075825 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -73,11 +73,15 @@ router.get('/gettopo', (req, res) => { router.get('/startcontroller', (req, res) => { var sys = require('sys') - var exec = require('child_process').exec; + var exec = require('child_process').spawn; var child; - chlid = exec("cd /home/pi/ryu && ./ejecutarcontroller.sh", function(error, stdout, stderr){ - console.log("startcontroller"); - res.send(stdout); + chlid = spawn('python', ['-f','./../pypy.py']); + + pyProg.stdout.on('data', function(data) { + + console.log(data.toString()); + res.write(data); + res.end('end'); }); }); module.exports = router;