UNPKG

probot

Version:

A framework for building GitHub Apps to automate and improve your workflow

19 lines (18 loc) 613 B
import { npxImport } from "npx-import-light"; let SmeeClient; export const createWebhookProxy = async (opts) => { try { SmeeClient ??= (await npxImport("smee-client@4.3.1", { onlyPackageRunner: true })).SmeeClient; } catch { opts.logger.warn("Run `npm install --save-dev smee-client` to proxy webhooks to localhost."); return undefined; } const smeeClient = new SmeeClient({ logger: opts.logger, source: opts.url, target: `http://${opts.host}:${opts.port}${opts.path}`, fetch: opts.fetch, }); return await smeeClient.start(); };