Starting the webserver
This page will explain how you start your webserver
Changing the webserver port
Before starting the webserver you need to open a port to the internet for it to be able to receive webhooks from the things stack. To change the port you need to change this variable in the index.js file.
const PORT = 3000
Changing the webserver path
The webhook from the things stack need a path to send the webhook. This can be changed by editing the string in the app.post
function in index.js.
app.post("/hook", (req, res) => { // "/hook" is default
addData(formatData(req.body))
res.status(200).end() // Responding is important
})
Starting the webserver
To start the webserver navigate into the folder where your server is located using your terminal or in windows you can open the folder Ctrl + Right-Click
and select open terminal here.
Next enter this command and you should see a message that your webserver is running on the assigned port.
node index.js

Last updated