1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/FastAPI_ynh.git synced 2024-09-03 18:36:00 +02:00

fix de l'exemple d'application Fastapi pour qu'elle marche dans un sous domaine

This commit is contained in:
leonard 2024-03-05 16:04:22 +01:00
parent 7e86230610
commit 3878b81781

View file

@ -5,8 +5,10 @@ from fastapi import FastAPI
UVICORN_ROOT_PATH = os.environ.get('UVICORN_ROOT_PATH') UVICORN_ROOT_PATH = os.environ.get('UVICORN_ROOT_PATH')
#app = FastAPI(root_path=UVICORN_ROOT_PATH) if UVICORN_ROOT_PATH and len(UVICORN_ROOT_PATH) > 0 and UVICORN_ROOT_PATH != '/':
app = FastAPI() app = FastAPI(root_path=UVICORN_ROOT_PATH)
else:
app = FastAPI()
@app.get("/") @app.get("/")
def read_root(): def read_root():