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