502 Bad Gateway

stephengladneyHOBBY

9 months ago

I'm running a Node (Express) server and getting a 502 when trying to access the site. I've added the PORT environment variable and also specified for the app to listen on 0.0.0.0. per this article: https://docs.railway.app/guides/fixing-common-errors

This is how I start the server.

app.listen(Number(process.env.PORT) || 3000, "0.0.0.0", () => {
  console.log("Flashcardly server is now running!")
})

I am seeing the console log in my logs on Railway and no errors are being logged nor is the app crashing. Am I missing something?

Solved

1 Replies

stephengladneyHOBBY

9 months ago

Disregard. Needed to re-deploy after setting the environment variable.


Status changed to Solved brody 9 months ago