When I click https://host/suburl/documentation
I have a "Failed to load definition".
In the console, I have
Error downloading https://host/openapi.json Failed to fetch
My code looks like that:
from fastapi import FastAPI
app = FastAPI(openapi_url="/openapi.json", docs_url="/documentation")
@app.get("/status")
def return_simple():
return "ok"
I can't find an anwser for this problem. Do you have any idea?
I found a solution. I launched fastapi with a "root-path" like this:
uvicorn fast_api.server:app --host 0.0.0.0 --port 8000 --root-path="/suburl"
Thanks for reporting back and closing the issue :+1:
Most helpful comment
I found a solution. I launched fastapi with a "root-path" like this: