diff --git a/install/web.js b/install/web.js index 40993d6d90..3eaf0c253f 100644 --- a/install/web.js +++ b/install/web.js @@ -69,18 +69,21 @@ function welcome(req, res) { } function install(req, res) { - req.body.url = "http://127.0.0.1"; - req.body.port = "4567"; - var parameters = JSON.stringify(req.body).replace(/"/g, '\\"'); + var env = {}; + req.body.port = "4567"; - var sys = require('sys'), - exec = require('child_process').exec, - command = 'node app.js --setup=\'' + parameters + '\''; + for (var i in req.body) { + if (req.body.hasOwnProperty(i)) { + env[i.replace(':', '__')] = req.body[i]; + } + } - exec(command, function(error, stdout, stderr) { - res.json(error, stdout, stderr); + require('child_process').fork('app', ['--setup'], { + env: env }); + + res.json({}); } function compileLess(callback) {