diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-01 00:12:49 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-01 00:12:49 +0900 |
| commit | 2d78329860795c8a2a4f2cd4eb8cd09945a93294 (patch) | |
| tree | 1750be84cdce117b1508b721ab19d59cd760718e /src/api/service | |
| parent | Fix: Add missing semicolon (diff) | |
| download | sharkey-2d78329860795c8a2a4f2cd4eb8cd09945a93294.tar.gz sharkey-2d78329860795c8a2a4f2cd4eb8cd09945a93294.tar.bz2 sharkey-2d78329860795c8a2a4f2cd4eb8cd09945a93294.zip | |
<WIP> #52
Diffstat (limited to 'src/api/service')
| -rw-r--r-- | src/api/service/github.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/api/service/github.ts b/src/api/service/github.ts new file mode 100644 index 0000000000..680c02c47a --- /dev/null +++ b/src/api/service/github.ts @@ -0,0 +1,18 @@ +import * as express from 'express'; +const createHandler = require('github-webhook-handler'); +import config from '../../conf'; + +module.exports = (app: express.Application) => { + if (config.github_bot == null) return; + + const handler = createHandler({ + path: '/hooks/github', + secret: config.github_bot.hook_secret + }); + + app.post('/hooks/github', handler); + + handler.on('*', event => { + console.dir(event); + }); +}; |