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.
- 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)
- Navigate into a folder of your choice.
- Open your terminal of choice in the directory (on Windows, you can simply shift + right-click and select "Open Powershell Window Here")
- Execute
git clone https://github.com/MStoltzfus/webhook_expressjs/
- Navigate to newly created folder using
cd webhook_expressjs
- 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) - 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.
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) |
- 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)
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.