misskey/src/api/service/github.ts

19 lines
417 B
TypeScript
Raw Normal View History

2017-02-01 00:12:49 +09:00
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);
});
};