clabot-fix
Version:
A bot to take the pain out of Contributor License Agreements
31 lines (24 loc) • 861 B
JavaScript
(function() {
'use strict';
var express, middlewares, routes, _;
_ = require('lodash');
express = require('express');
middlewares = require('./lib/middlewares');
routes = require('./lib/routes');
exports.createApp = function(options) {
var app;
_.defaults(options, {
skipContributors: true,
skipCollaborators: false
});
app = options.app ? options.app : express();
options = _.pick(options, ['getContractors', 'addContractor', 'token', 'templates', 'templateData', 'secrets', 'skipCollaborators', 'skipContributors']);
app.use(middlewares.allowCrossDomain);
app.use(middlewares.provideClabotOptions(options));
app.use(middlewares.parseBodyKeepRaw);
app.use(express.bodyParser());
app.get('/', routes["default"]);
app.post('/notify', routes.notify);
return app;
};
}).call(this);