X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=src%2Froutes%2Findex.js;h=70758258231c1c6092ebfaeed0b650927854249a;hp=3e06433a467fe7452bd957341260405bf96c0fd5;hb=dbf58d4a68b7e47ead6f07d5cbfaf0cc9c91eb53;hpb=dbac5cb460f04625bc2a9e414e51900c9777d3ae 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;