Payload CMS App Doesn't Appear to work correctly

jared-leddyHOBBY

a year ago

I've got an app that works correctly localhost, but when I deploy to Railway, the only thing I get is the app error page shown.

I've checked the logs and there aren't any errors. How do you debug this?

0 Replies

a year ago

please see this docs page -


a year ago

n/a


jared-leddyHOBBY

a year ago

Thanks. The Railway service didn't add a port, so I manually added one and it's working as expected.


a year ago

It's not supposed to, as mentioned, your app should listen on the PORT environment variable


jared-leddyHOBBY

a year ago

Good to know, because the docs say otherwise. I found this text on the page. I checked for the Railway-provided variables and didn't find port listed.

Thus, your web server must listen on host 0.0.0.0 and the port that Railway provides in the PORT environment variable.

jared-leddyHOBBY

a year ago

1223848321014169600


a year ago

it's not provided in the service variables, it's automatically generated for your app when you deploy


a year ago

as you can see, the approach you took is not recommended


jared-leddyHOBBY

a year ago

I see that.


jared-leddyHOBBY

a year ago

If it's not an ENV variable, then what is it, and where do I find it?


a year ago

it is an environment variable, I'm not sure where the confusion is coming from?


a year ago

as that docs page states, your app simply needs to listen on the environment variable PORT


jared-leddyHOBBY

a year ago

I see what you're saying now. I was reading it inversely. Like I need to find the port in Railway and set that up in my app.


jared-leddyHOBBY

a year ago

Fixed it in my app, and redeploying now. Will close if all is well.


a year ago

please do not close threads


jared-leddyHOBBY

a year ago

Ok. Sure. Just curious as to why you wouldn't want them closed.


a year ago

closing threads on discord hides them


jared-leddyHOBBY

a year ago

That's interesting. I've never seen that happen before. Maybe it's a config thing? Not sure.

On the Nest.js server, we close threads when problems are solved. It just moves it down to a different section. On there, the threads are structured like this:

Open Threads
Older Posts (closed threads)

So, when you close it, they just move down. Both also show up in search as well.

1223852394987913200


a year ago

not sure, I didn't set it up, all I know is that when a user closes their thread it looks like it has disappeared, for us we mark the thread as solved with a tag


a year ago

have not yet figured out if it is possible to remove a users permission to close a thread


Payload CMS App Doesn't Appear to work correctly - Railway Help Station