From 859e7593e1bec1280ae4a6647815ad8dd8bc0021 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 22 Apr 2015 11:22:55 -0400 Subject: [PATCH] basic installer function --- install/web.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/install/web.js b/install/web.js index f87c4d024d..40993d6d90 100644 --- a/install/web.js +++ b/install/web.js @@ -69,7 +69,18 @@ function welcome(req, res) { } function install(req, res) { - console.log(req.body); + req.body.url = "http://127.0.0.1"; + req.body.port = "4567"; + var parameters = JSON.stringify(req.body).replace(/"/g, '\\"'); + + + var sys = require('sys'), + exec = require('child_process').exec, + command = 'node app.js --setup=\'' + parameters + '\''; + + exec(command, function(error, stdout, stderr) { + res.json(error, stdout, stderr); + }); } function compileLess(callback) {