R
Railway10mo ago
Michael

Web Server Not Working

I just started a small simple web server. I generated a custom domain for now, and when trying to access it I'm being met with Application failed to respond
17 Replies
Percy
Percy10mo ago
Project ID: 5cbfb706-f70d-4814-9834-3f94646c5518
Michael
Michael10mo ago
5cbfb706-f70d-4814-9834-3f94646c5518
Fragly
Fragly10mo ago
did you use env.PORT for your port?
Michael
Michael10mo ago
No I just used 3000 hard coded
Fragly
Fragly10mo ago
You should use env.PORT then only works if you use the port railway provides
MantisInABox
MantisInABox10mo ago
If you used 3000 hard coded, set env variable of PORT to 3000 in your service
Fragly
Fragly10mo ago
oh you can do that?
Michael
Michael10mo ago
ok
MantisInABox
MantisInABox10mo ago
Yup
Fragly
Fragly10mo ago
is that new?
MantisInABox
MantisInABox10mo ago
Nope
Fragly
Fragly10mo ago
dang
MantisInABox
MantisInABox10mo ago
It's better to listen on the port provided, but if you specify it in your code or if it's a docker image, you can set it manually
Michael
Michael10mo ago
so wait am I able to just not create a port variable on railway
MantisInABox
MantisInABox10mo ago
Yes, you can create an environment variable in your service and call it PORT and give it the value of 3000
MantisInABox
MantisInABox10mo ago
Like this
No description
Michael
Michael10mo ago
Okay thank you