-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.js
33 lines (29 loc) · 929 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const ProbotExports = require("probot");
const azureFunction = require("./azure-function");
const azureFunctionV4 = require("./azure-function-v4");
module.exports = {
...ProbotExports,
createAzureFunction,
createAzureFunctionV4,
};
/**
*
* @param {import('probot').ApplicationFunction} app
* @param { { probot: import('probot').Probot } } options
*/
function createAzureFunction(app, { probot }) {
// load app once outside of the function to prevent double
// event handlers in case of container reuse
probot.load(app);
return azureFunction.bind(null, probot);
}
/**
* @param {import('probot').ApplicationFunction} app
* @param { { probot: import('probot').Probot } } options
*/
function createAzureFunctionV4(app, { probot }) {
// load app once outside of the function to prevent double
// event handlers in case of container reuse
probot.load(app);
return azureFunctionV4.bind(null, probot);
}