Run a uvicorn python app on Railway
In the past I have run multiple express apps with
const PORT = parseInt(process.env.PORT '') 8000
app.listen(PORT, '0.0.0.0', () => {
console.log('NODE_ENV: ', process.env.NODE_ENV)
console.log('listen port ' + PORT)
})
I tried to do the sae thing in uvicorn and run my app like this
PORT = int(os.getenv("PORT", "3000"))
if name == "main":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=PORT)
but my app is not working. Any idea what I am doing wrong? This is my app https://railway.app/project/54f3e95e-8713-41a2-991f-af3046b64747/service/5b305d04-6b17-4767-bab6-1fe015d8b8dd
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
8 Replies
Project ID:
54f3e95e-8713-41a2-991f-af3046b64747,5b305d04-6b17-4767-bab6-1fe015d8b8dd
can you define not working?
and what do you see instead
I guess now I see this
withatlaslabs.com redirected you too many times.
which might be a DNS issue?
Solution
Got it working thanks so much for your help!!
no problem!