No PORT env variable
andwillall
HOBBYOP
2 years ago
I'm trying to deploy a Node Express app and keep getting my process.env.PORT value as undefined... I did a console.log: JSON.stringify(process.env). I see the variables I set, and others set by Railway, but no PORT. As a result, my build times out and I get an application failed to load error. What am I missing here?...
3 Replies
2 years ago
The PORT variable is not available at build time, only runtime.
I'm curious as to why your build needs a PORT variable?
Status changed to Solved Railway • almost 2 years ago
andwillall
HOBBYOP
2 years ago
Thanks Brody. My mistake, got the build command confused with the start command.