This commit is contained in:
William Mantly 2016-02-03 13:21:39 -05:00
parent 48b4dd5453
commit d136e97fa5

View File

@ -92,9 +92,19 @@ router.get('/list', function(req, res, next) {
});
});
router.post('/run/:ip?', function(req, res, next){
if(req.params.ip){
router.post('/run/:ip?', function doRun(req, res, next){
// check if server is
lxc.list(function(data){
var ip = '10.0.'+ req.params.ip;
data.forEach(function(idx, element){
if(element.ipv4 === ip){
runner(req, res, ip)
}
});
});
if(req.params.ip){
return runner(res, req, ip);
}else{
var name = 'u1-'+(Math.random()*100).toString().replace('.','');