#help with a express and mysql app

3 messages · Page 1 of 1 (latest)

torpid lintel
#

hi guys, I keep getting the "Is your app correctly listening on $PORT?" error, my code is the following:
const PORT = process.env.PORT || 3001; app.listen(PORT, () => console.log("server " + PORT + " ok"));

I do have a .env PORT variable declared but it seems nodeJS keeps using 3001 and that may cause railway to crash when I try to open the site... any ideas please?
should I set up anything else on railway?

gleaming hamlet
#

require('dotenv').config(); ?

#

app.listen(process.env.PORT || '3000', () => {
console.log("Server started");
});