1.0.3 • Published 7 years ago

uphook v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

uphook

express middleware to automatically update and restart an application based on github/gitlab webhook.

usage

if verified hook on right branch, git force-pulls to current branch and calls the callback.

let hook = require('uphook').github({
  secret: process.env.GH_SECRET,
  verify: function(req, res){
    return true;
    //before it calls gitupdate(), can return false to cancel that.
  },
  callback: function(err, payload){
    if(!err)
      process.exit(0); //lets PM2 restart the process
  }
});
app.use('/gh-update', hook);

note that you should definitely use SSL because GitLab doesn't have HMAC, which is dumb.

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago