This commit is contained in:
William Mantly 2018-10-14 16:14:33 -04:00
parent c3293e1ec4
commit 3072ebe966
Signed by: wmantly
GPG Key ID: E1EEC7650BA97160
3 changed files with 8 additions and 4 deletions

3
app.js
View File

@ -21,7 +21,8 @@ app.use(function(err, req, res, next) {
// render the error page
res.status(err.status || 500);
res.json({message: 'error!'});
console.dir(err)
res.json({message: err.message});
});
module.exports = app;

View File

@ -6,6 +6,7 @@
"start": "node ./bin/www"
},
"dependencies": {
"express": "^4.16.4"
"express": "^4.16.4",
"forever": "^0.15.3"
}
}

View File

@ -63,12 +63,14 @@ router.all('/', function(req, res, next) {
var call = (req.body.created && 'create') ||
(req.body.deleted && 'delete') ||
'update';
console.log('body');
var branch = req.body.ref.replace('refs/heads/', '');
var sshURL = req.body.repository.ssh_url;
if(call === 'update' && !fs.existsSync('/var/www/gitwrapper/'+name)) call = 'create';
console.log('body');
console.log('branch', branch, 'sshURL', sshURL)
// if(call === 'update' && !fs.existsSync('/var/wres.locals.messageww/gitwrapper/'+name)) call = 'create';
// return calls[call](req, res, branch, sshURL);
});