Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
probot.errorHandler,
)
apps.forEach(appFn => probot.load(appFn))
/* Load express apps */
probot.server.use('/validate', validator)
// Register error handler as the last middleware
probot.server.use(logRequestErrors as any)
/* Load Webhook Proxy */
if (process.env.WEBHOOK_PROXY_URL) {
createWebhookProxy({
logger: probot.logger,
port,
path: '/',
url: process.env.WEBHOOK_PROXY_URL,
})
}
/* Start the server */
const server = probot.server.listen(port)
return server
}
const startServer: StartServer = () => {
const server = probot.server.listen(0);
const { port } = server.address() as { port: number };
const smeeEvents = createWebhookProxy({
logger: {
error: nop,
info: nop,
warn: nop,
},
path: "/",
port,
url: env.TEST_SMEE_URL,
});
return () => {
smeeEvents.close();
server.close();
};
};