App loading forever/timing out with app.get/app.post

It keeps happening and it’s been doing this for quite some time

here’s the code:

const express = require(“express”);
const app = express();

//get
app.get("/", function(req, res){
console.log(“Hi”)

});

//listener??
const listener = app.listen(process.env.PORT, function() {
console.log("Your app is listening on port " + listener.address().port);
});

when accessing my website, it just loads forever until there is an error

You’re not returning anything from the app.get("/"), so Express doesn’t have anything to send back. Try something like this:

// requires...

app.get("/", function(req, res) {
  console.log("Hi")
  res.send("Hello, world!")
})

// listener...