What I’ve found is that if I don’t add the following code to my index.js file, I am not able to run the localhost:

1
2
3
app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`)
})

The code still runs when you do npm start, but upon end of code, it simply terminates, whereas if you do app.listen, you could inspect the output at a port.