---
description: This page will explain how you start your webserver
---

# Starting the 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.

```javascript
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.

<pre class="language-javascript"><code class="lang-javascript"><strong>app.post("/hook", (req, res) => { // "/hook" is default
</strong>    addData(formatData(req.body))
    res.status(200).end() // Responding is important
})
</code></pre>

### 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.

```bash
node index.js
```

<figure><img src="https://1355723674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFK9KBgKtblLSGBcSkhh3%2Fuploads%2FgqFE4N4wjUggoHhbaBvT%2F2023-04-15%2015_41_35-Starting%20the%20webserver%20-%20WEBHOOK%20SERVER%20-%20Vivaldi.png?alt=media&#x26;token=144e876a-6a0f-4393-b132-3575aa220e99" alt=":Rocket: Server is running on port (configured port)"><figcaption><p>You should see this message if your server is running</p></figcaption></figure>
