How to use the probot/lib/webhook-proxy.createWebhookProxy function in probot

To help you get started, we’ve selected a few probot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opencollective / opencollective-bot / src / index.ts View on Github external
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
}
github tibdex / autorebase / src / tests-utils.ts View on Github external
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();
    };
  };