local-webhook
Zero-configuration localhost webhooks. Do not use in production.
Installation
yarn add -D local-webhook express
Note: express
is a required peer dependency.
Usage
Setup and generate webhook as a Promise:
; // Option 1: open ssh tunnel to localhost.run service (default).await LocalWebhook;// Option 2: use ngrok.await LocalWebhook; // Generate an awaitable webhook Promise.const webhook = LocalWebhook; // This URL can be shared with third-party services.// Ex: https://sushi.localhost.run/wasabiwebhook; // Handle third-party service's webhook request once.webhook; // Awaitable if necessary.await webhook;
Generate webhook as an Observable:
// Generate a webhook Observable.const webhook = LocalWebhook; // This URL can be shared with third-party services.// Ex: https://sushi.ngrok.io/ichibanwebhook; // Handle third-party service's webhook requests each time.webhook;
To inspect and replay requests, open ngrok's web interface at localhost:4040.
Peer dependencies
- expressjs/express - http server (required)
- bubenshchykov/ngrok - a ngrok wrapper
Community
Let's start one together! After you ★ this project, follow me @rygu on Twitter.
Thanks
License
BSD 3-Clause license. Copyright © 2018, Rick Wong. All rights reserved.