FastAPI + Uvicorn ... which port?

I'm trying to deploy a FastAPI app using uvicorn main:app --host 0.0.0.0 --port ??? --log-level warning, but I'm not sure which port to use. I've tried 80 and 5000, but I get this error:
Is your app correctly listening on $PORT?
So ... which port is $PORT?
3 Replies
JustJake
JustJake3y ago
process.env.PORT Like the port environment variable You can also set it in Variables and we'll respect that So like if you're listening on 5000, just set the PORT=5000 and it'll work
tiltowait
tiltowaitOP3y ago
I'll give it a try! That worked. Thank you!
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server