git-web-hooks
A module for reacting to git webhooks.
Example
const GitWebhooks = PORT: 3333 // optional. 3333 is default
Commands
Doing something useful with the webhooks probably means you will run some commands. GitWebhooks.command
is a thin wrapper around child_process.exec
that returns a promise. You can use this to run commands like git pull
or npm install
.
var cmd = GitWebhooks // it's a Promise!cmd // and you can pass options to child_process.execGitWebhooks
Daemonize
To keep the process alive, you should use a daemonizer like nohup, forever, pm2, or others.
nohup your-hook-server.js &
forever start your-hook-server.js
pm2 start your-hook-server.js