github-webhook-forwarding
Version:
Forwards Github Webhooks to overcome the maximum number of webhooks allowed by Github (20)
29 lines (24 loc) • 746 B
JavaScript
var express = require('express')
var handleWebhook = require('./handlewebhook')
var handleSubscription = require('./handlesubscription')
var fallback = require('./fallback')
var logRequest = require('./logrequest')
var authorize = require('./authorize')
var status = require('./status')
module.exports = exports = Server
function Server (config) {
var app = express()
if (config.verbose) {
app.use(logRequest)
}
// status check
app.get('/\\$api/status', status)
// app endpoints
app.post('/push', handleWebhook(config))
app.post('/subscribe', authorize(config), handleSubscription(config.subsFilePath))
app.use(fallback)
this.app = app
this.config = config
}
Server.prototype.start = require('./start')