Giter Site home page Giter Site logo

sitedata / webhook_expressjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mstoltzfus/webhook_expressjs

0.0 2.0 0.0 262 KB

Just a simple ExpressJS app that opens up a server on localhost:3050 and uses the localtunnel API to automatically create a publicly accessible tunnel link to the app. It was created as a way to accept incoming webhooks on your local machine as an alternative to creating Microsoft PowerAutomate Flows or relying on something like RequestBin & Pipedream.

JavaScript 100.00%

webhook_expressjs's Introduction

webhook_expressjs

Just a simple ExpressJS app that opens up a server on localhost:3050 and uses the localtunnel API to automatically create a publicly accessible tunnel link to the app. It was created as a way to accept incoming webhooks on your local machine as an alternative to creating Microsoft PowerAutomate Flows or relying on something like RequestBin & Pipedream.

Preview

screenshot

Installation

Machine Prerequisites

  • Git https://git-scm.com/ (To pull the code from the Github Repository)
  • Node https://nodejs.org/en/download/ (To host/run the app on your local machine)

Install Steps

  1. Navigate into a folder of your choice.
  2. Open your terminal of choice in the directory (on Windows, you can simply shift + right-click and select "Open Powershell Window Here")
  3. Execute git clone https://github.com/MStoltzfus/webhook_expressjs/
  4. Navigate to newly created folder using cd webhook_expressjs
  5. Execute npm install (This will download the node packages that this project depends on to run; failing to do this will result in module errors when you attempt to launch the app in the next step)
  6. Execute npm start (launches the Express.JS app)

Connection URLs for both local and public connections to the app will be displayed upon successful launch of the app in your console.

Usage options

The following URL endpoints are available

URL Route HTTP Verb Description
"/" GET Gives a simple text response
"/" POST Sends an immediate response to a request with a JSON payload and console logs the parsed JSON to the console in which the app is running
"/webhook" GET Gives a simple text response
"/webhook" POST Sends an immediate response to a request with a JSON payload and console logs the parsed JSON to the console in which the app is running
"/url" GET Responds with the public localtunnel URL (implemented to solve the first-world problem of not wanting to scroll all the way to the top of the console to get it)

App Package Dependencies

  • Access to the internet to establish a localtunnel connection.
  • npm package express (base framework for the app)
  • npm package localtunnel (API used to automatically create a tunnel to application at launch)
  • npm package moment (used to display a pretty timestamp when a POST request is made)
  • npm package nodemon (dev dependency - hot reloads the Node server when editing the code)

Credits

Microsoft PowerAutomate and PipeDream bugs which gave me the motivation to learn a new backend framework so I could stop relying on them for testing simple webhooks.

webhook_expressjs's People

Contributors

mstoltzfus avatar

Watchers

James Cloos avatar  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.