Webhook and Url error
ahmad55666
FREEOP

4 months ago

Need help with Railway + FastAPI
My app works fine on localhost — all routes like /webhook work.
But on Railway, only /health works — everything else shows 404 Not Found.

No errors in logs, app starts fine.
I’m using uvicorn app:app.

Maybe the railway.toml or start command is wrong?
Example:

uvicorn main:app --host 0.0.0.0 --port $PORT

Any idea why only /health works?
( I am on free plan )

$10 Bounty

3 Replies

peacocksir
HOBBY

4 months ago

first, make sure your start command/toml matches the cmd and stuff

railway sometimes sets a root path if your app is behind a proxy path so try explicitly settings root_path='' to make sure it doest expect a sub path

app = FastAPI(root_path=os.getenv("railway url", ""))

if you can show more stuff then please cuz kinda hard to diagnose


ahmad55666
FREEOP

4 months ago

I mean what kind of the things you wanna see @money_mountain


peacocksir
HOBBY

4 months ago

Code which starts server, and your toml file. Anything relevant


Loading...