forked from mirrors/probot
Server that responds to webhooks
This commit is contained in:
parent
1f838dfb1c
commit
6ca4415c72
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "probot",
|
||||
"version": "1.0.0",
|
||||
"description": "a trainable robot that responds to activity on GitHub",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"author": "Brandon Keepers",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"github": "^3.1.0",
|
||||
"github-webhook-handler": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^3.0.2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
var http = require('http')
|
||||
var createHandler = require('github-webhook-handler')
|
||||
var handler = createHandler({ path: '/', secret: 'secret' })
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
handler(req, res, function (err) {
|
||||
res.statusCode = 404
|
||||
res.end('no such location')
|
||||
})
|
||||
}).listen(3000)
|
||||
|
||||
handler.on('pull_request', function (event) {
|
||||
console.log('event', event);
|
||||
})
|
Loading…
Reference in New Issue