From 3072ebe966998186c039524df45a8f3679748227 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Sun, 14 Oct 2018 16:14:33 -0400 Subject: [PATCH] updates --- app.js | 3 ++- package.json | 3 ++- routes/index.js | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index a23b55a..b3cb163 100644 --- a/app.js +++ b/app.js @@ -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; diff --git a/package.json b/package.json index efbe151..a1db793 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "start": "node ./bin/www" }, "dependencies": { - "express": "^4.16.4" + "express": "^4.16.4", + "forever": "^0.15.3" } } diff --git a/routes/index.js b/routes/index.js index 61c160b..f3cd3a6 100644 --- a/routes/index.js +++ b/routes/index.js @@ -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); });