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/
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
1 Replies
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
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).
