GithubHelp home page GithubHelp logo

adammendoza / example-webhook-nodejs-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from respoke/example-webhook-nodejs-server

0.0 1.0 0.0 168 KB

A Node.js server boilerplate for responding to Respoke webhooks.

License: MIT License

JavaScript 100.00%

example-webhook-nodejs-server's Introduction

example-webhook-nodejs-server

Processing Webhooks from Respoke

Webhooks are a powerful, yet little known feature of Respoke.

When events happen in your app - like endpoints joining or leaving a group - you can get notified via webhook.

Prerequesites

0. Download ngrok (optional)

For fast local development, this example will use ngrok to tunnel a port on your localhost to a subdomain of ngrok. This lets Respoke send you webhooks on https://your-custom-subdomain.ngrok.com and the requests are proxied to your local machine.

Download ngrok and take note of where you put the ngrok file.

1. Configure your webhook

To get started, go the the Respoke dev portal and create a new app.

Then navigate down to the Webhooks section.

respoke dev portal webhook URL input

Put in your webhook endpoint and hit Update.

If you're using ngrok, just make up something like https://actual-cannibal-shia-labeouf.ngrok.com.

2. Clone the repo and install

An example webhook server is on the Respoke GitHub:

git clone https://github.com/respoke/example-webhook-nodejs-server
cd example-webhook-nodejs-server
npm install

3. Run the webhook server

npm start

The server will run on http://localhost:3009 and print incoming webhooks.

4. Fire up the ngrok tunnel (optional)

cd path/to/ngrok/folder
./ngrok --subdomain=actual-cannibal-shia-labeouf 3009

This tells ngrok to tunnel all requests to https://actual-cannibal-shia-labeouf.ngrok.com to your localhost:3009.

5. Receive webhooks

Next, do something that initiates some Respoke activity. You could clone the web examples and set them up to use your appId.

example webhook traffic

That's really all it takes to start responding to webhooks.

example-webhook-nodejs-server's People

Contributors

ruffrey avatar

Watchers

Adam J. Mendoza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.