My first app deploys, but no website?
fergalm
FREEOP

15 days ago

I have a hello-world app that I'm trying to deploy using railway as a way of learning the system. The app deploys, but I can't load the website.

The app name is pjmapp (and it's my only app so far). The public github repo is at

https://github.com/fergalm/pjmapp/

The deploy logs are at https://railway.com/project/2ecba21c-41fa-46ec-b89d-d0fbe58d0dc7/service/59e96394-2307-41ba-929a-927c125c5768?environmentId=7fb90083-f3de-46b8-872e-86e844f34b53&id=7fb50592-3ea7-4c47-944f-e79425729b23#details

Following the docs, I indicate that pjmapp is a python project by putting a file called app.py in the root directory. app.py looks like


from flask import Flask

from py import main

app = Flask(__name__)

@app.route("/query/<iso>")

def query(iso):

    return main.query(iso)

The deployment is successful, but when I go to https://pjmapp.up.railway.app/ I get a 502 error.

I've tried various combinations of

https://pjmapp.up.railway.app:5000

https://pjmapp.up.railway.app/query/pjm

https://pjmapp.up.railway.app:5000/query/pjm

Adding the port number solves the 502 error, but instead the page times out without a response. The app works locally for me, and has no exotic dependencies (other than flask it imports datetime, json, and pprint)

I suspect I'm doing something wrong in the Flask/gunicorn area, because I'm not familiar with those tools

$10 Bounty

1 Replies

Railway
BOT

15 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 15 days ago


If your app is listening on port 5000, just go to service settings > networking and map that port to your URL (set target port to 5000).


Welcome!

Sign in to your Railway account to join the conversation.

Loading...