R
Railway

✋|help

Anyone who has recently deployed a nodejs server on railway willing to help?

Ffrostycucumber_653439/5/2023
My server runs fine locally, however when deployed its not listening to the requests. I put in the run command as "node dist/index.js" which works perfectly fine in the local machine. I am also listening to the recommended port "process.env.PORT" which railway provides as an environment variable and ip of '0.0.0.0' as mentioned in the docs. Not sure what am I doing wrong here.
Ffrostycucumber_653439/5/2023
db634f71-f603-49d6-a5b1-73020aa17159
I apologize but I only see "service id" in the settings
not the project id
Bbrody1929/5/2023
show me the code that runs the server?
Ffrostycucumber_653439/5/2023
Which part would you like me to paste here
Bbrody1929/5/2023
the code that runs the server
Ffrostycucumber_653439/5/2023
you mean the build script?
Bbrody1929/5/2023
no
Ffrostycucumber_653439/5/2023
like the entire server code?
Bbrody1929/5/2023
no
can you share the repo instead
Ffrostycucumber_653439/5/2023
not sure if its ok to ask but can I pay you for an hour of your time and add you to the repo? I am undergoing a SOC2 audit right now and its a private repo
its just 300 lines of code
Bbrody1929/5/2023
put me in the repo brody192
Ffrostycucumber_653439/5/2023
ok gimmi sec
i think github is down just keeps spinning when adding collaborator pls give me one min
Ffrostycucumber_653439/5/2023
oh damn
now it seems to work
adding
added
Bbrody1929/5/2023
delete the dist and ds store file from the repo, then add dist/ and .DS_Store to your .gitignore
Ffrostycucumber_653439/5/2023
I see ok one min thanks
done
let me check once
yes i think I did it
should i check deployement?
Bbrody1929/5/2023
of course
Ffrostycucumber_653439/5/2023
Ok this is ridiculus it works! How though!!
Thanks allot
Bbrody1929/5/2023
while you may have been using process.env.PORT in the typescript code, the built index file in dist was old and outdated, still listening on a fixed port
Ffrostycucumber_653439/5/2023
Wow, I would have never guessed
is there a way to tip you good sir?
do you also offer consulting?
thank you again
Bbrody1929/5/2023
if you absolutely insist, there's a buymeacoffee in my bio, do not feel obligated to send anything, I never expect anything in return
Ffrostycucumber_653439/5/2023
Thank you so much, let me find that link
Done, thanks again, can I add you as a friend?
Bbrody1929/5/2023
sure!
Ffrostycucumber_653439/5/2023
Sorry i am new to discord just figuring it out
Bbrody1929/5/2023
no worries
and thanks for the trains 🙂
Ffrostycucumber_653439/5/2023
haha sure thing! I guess friend reqs are not allowed
Bbrody1929/5/2023
they should be, but I have no clue
you're always welcome to open more help threads me or the other conductors will be around
Ffrostycucumber_653439/5/2023
Thank you that sounds amazing
So on ec2 I used to run these jobs using pm2, is it neccessary to do that in this case as well or would node dist/index suffice?
Just making sure the server wouldn't stop
Bbrody1929/5/2023
node dist/index.js would suffice, since railway would restart your deployment if it crashed
Ffrostycucumber_653439/5/2023
I see that sounds really great
Bbrody1929/5/2023
lot a problems can arise from using pm2 or nodemon on railway in fact
Ffrostycucumber_653439/5/2023
Oh I see
Bbrody1929/5/2023
though I know those are two different things, you get my point lol
Ffrostycucumber_653439/5/2023
Yeah no I get it
Bbrody1929/5/2023
any more questions?
Ffrostycucumber_653439/5/2023
Deploying the main project to see if it connects to wss 😄
not yet 😄
Bbrody1929/5/2023
where is the websocket server hosted?
Ffrostycucumber_653439/5/2023
railway?
guess i didn't get the question
Bbrody1929/5/2023
oh I thought the deployment on railway is connecting to a different websocket server
Ffrostycucumber_653439/5/2023
Oh no, i have a next js project that connects to the socket server
Bbrody1929/5/2023
ah I see, we'll let me know if you have any troubles
Ffrostycucumber_653439/5/2023
thank you will do

Looking for more? Join the community!

Recommended Posts
Is there a way to auto restart a service to save memory? There an api available that we can trigger?I want to see if there is a way to restart my service in specified durations. if there's an api trigHow to using 3.0.0 dart version?``` #10 [6/9] RUN dart pub get #10 0.566 Resolving dependencies... #10 0.666 The current Dart Using AND in logs Search and fetching these via an APII want to use AND to search the logs with both the keywords, currently the logs search assumes OR whAccessing current Nixpacks fileI need to install Poppler on my Railway environment. From what I can see one way to do this is via tI am having trouble connecting to Azure Data Studio (Postgres)I am trying everything can't seem to connect to ADS any advice? This is the error I'm recieving ``API accusing Application failed to respond in development environmentI'm trying to run my application in the development environment, but it gives an error. It only runsAPI accusing Application failed to respond in development environmentI'm trying to run my application in the development environment, but it gives an error. It only runsRestore old logs?Hi! Is there a way to restore old log feature while you figure out the kinks in the new one? The newSource IPsIm sure I'm missing it in the documentation But is there a list of source IPs from railway deploymeError running the application in the background.I cannot or the screen -S command is not executed in my program, and I do not know what the solutionMedical System To ProductionHello, I am developing a medical system and I want to put it into production using Railway so that eDeploy restarted near the endJust deployed a change (573e8198-6981-45c6-81ae-91d5210afc0c) and it got through the build, then staFiles uploadGood afternoon, I would like to create a small SaaS application and deploy it entirely to railway. Upgrade To Hobby Plan:Why am I unable to upgrade to a Hobby Plan? Your UI keeps getting stuck on this page each time I tryRedis not configured properly for DjangoHi, I'm trying to use Redis with Django and Channels. I keep getting this error message which seems Inspecting built Docker Image locallyHello I have an issue in my application when running in Railway. I would like to download the image Is there someway for me to choose a custom range in the observability?docker flask shows Application failed to respondRepo: https://github.com/chamuditha4/flask1 URL : https://flask-production-7492.up.railway.app/ prGetting 503 Server Error during load testsI'm load testing a simple fastapi backend running on railway. Using locust for load testing with 100Ideal way to compose and manage a full stack app?Railway doesn't really seem to be exposing an example of how one could/should compose a full stack a