503 error after deploy
I'm trying to deploy a NodeJS application with express, apollo client and MongoDB Atlas, the build and deploy complete successfully but I can't access the API (I get 503)
14 Replies
Project ID:
837ab9b4-5e5c-440b-aadc-41a59407c4d9
837ab9b4-5e5c-440b-aadc-41a59407c4d9
do you see any errors in your server logs? What's your
PORT
environment variable?My listen port is process.env.PORT (railway port)
Didn’t give any error
My server log
try tweaking express to listen on
0.0.0.0
:
also make sure that you don't have a PORT
service variable setthis is strange because express will listen on 0.0.0.0 by default unless maybe Apollo is changing the default behaviour, thanks for the help rc!
I tried but it didn't work, any other possibilities of what it could be?
im stumped
do you think you could share your repo?
yes, sure i'll make it public
GitHub
GitHub - sgalvao/rifa-api
Contribute to sgalvao/rifa-api development by creating an account on GitHub.
ah yes, youre committing the built dist folder to github and rimraf isn't overriding the build dist
https://github.com/sgalvao/rifa-api/blob/718b2d11213d9f6439c8aae338ad751ee53aeeed/dist/src/server.js#L38
its listening on port 3000, but logging that its listening on env.PORT
add dist to your .gitignore then do this stuff
https://stackoverflow.com/a/19095988/13155318
it worked, thank you very much, I was even ashamed after seeing what the problem was haha! saved my weekend bro! thanks
no problem!
rc was a big help too