Receiving "Application failed to respond" message

everettmckay
HOBBY

a year ago

I just started with Railway yesterday. My goal is to switch from my github-based node/express app from Cyclic (where it worked) to Railway. Process was simple, but I can’t figure out this error message.

I reviewed the Getting Started doc, plus https://docs.railway.app/guides/fixing-common-errors#solution. Based on this, I confirmed the host and port. Here is the call:

const theHost = "0.0.0.0";
const port = Number(process.env.API_PORT) || 3000;
app.listen(port, theHost, () => {
console.log(${ServerName} running on host ${theHost} using port ${port} (v${getVersion()}));
});

And here is the result in the Railway Deploy log:

Server running on host 0.0.0.0 using port 3000 (v0.0.108)

Yet, the "Application failed to respond" error remains when I access the provided url in a browser and I’m not finding any other steps to perform. What should I do now?

Solved

2 Replies

a year ago

As the docs page you linked mentioned, you want PORT not API_PORT.


Status changed to Solved Railway about 1 year ago


everettmckay
HOBBY

a year ago

And that worked…thanks! Surprised though, because the port was set to 3000 either way.