RESTAPI FiveM Error (ECONNREFUSED)

Hi everyone, hope you are well.

I have tried setting up a RestAPI using Express on my FiveM server for some implementation with an external project.

The main.js file consist of nothing more than what is outlined below:

const express = require('express')
const app = express()
const PORT = 8080;


app.get("/", function(request, response){ 
    print("GET Request made")
});


app.listen(PORT, () => {
     console.log("Running on port "+ PORT);
});

And this is how I am calling the endpoint:

await axios({
  method: "GET",
  url: "http://127.0.0.1:8080",
  headers: {"Content-Type": "application/json"}
})

However, when trying to connect to my API using the external project with Axios, I get a ECONREFUSED error. I have looked around the internet for a fix but nothing has yet worked. Someone mentioned that this error may be because the source is refusing the connection. In other words, the Express server running on my FiveM server is refusing to make the connection.

If anyone can offer any help, that would be great.
Thanks!