Got it, path http://127.0.0.1:8000/
is not directly accessible. Due to ingress, its under the route where it is part of.
Changed path as below
@app.get("/fastapi")
def f():
return "Hello from the root!"
Now I can call
❯ curl http://127.0.0.1:8000/api1/fastapi
"Hello from the root!"