From 9b5ed13bdd7e001db70abac04f533720ff08f798 Mon Sep 17 00:00:00 2001 From: william Date: Tue, 2 Feb 2016 14:15:07 -0500 Subject: [PATCH] runner --- routes/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/api.js b/routes/api.js index 8a829c3..4fee5db 100644 --- a/routes/api.js +++ b/routes/api.js @@ -85,10 +85,10 @@ router.get('/list', function(req, res, next) { }); router.post('/run/:ip?', function(req, res, next){ - + var runner = function(res, req, ip){ console.log('runner on', ip,'with body:\n', typeof req.body); - return request.post({url:'http://'+ip, json: req.body}, function(error, response, body){ + return request.post({url:'http://'+ip, body: JSON.stringify(req.body)}, function(error, response, body){ // console.log('request args:', arguments) body = JSON.parse(body); body['ip'] = ip.replace('10.0.', '')