Skip to content

Exposing Ports

The Railway documentation says the following about the listening to ports:

The easiest way to get up and running is to have your application listen on 0.0.0.0:$PORT, where PORT is a Railway-provided environment variable.

So, passing the host as 0.0.0.0 to app.start() as an argument is necessary.

We need to create a Railway account to deploy this app on Railway. We can do so by going on the Railway HomePage.

Press the "Login" button and select "login with a GitHub account."

Then, we press the "New Project" button and select "Deploy from GitHub repo".

Then we select the repo we want to deploy. And click "Deploy Now".


Now, we click on our project's card.

Select "Variables" and press the "New Variable" button to set the environments variables.

Then, we go to the "Settings" tab and click on "Generate Domain."

We can generate a temporary domain under the "Domains" tab.

We can go to our domain <domain>/hello and confirm that the message "Hello World" is displayed.

Next Steps

Released under the MIT License.