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:
parent
7e86230610
commit
3878b81781
1 changed files with 4 additions and 2 deletions
|
@ -5,7 +5,9 @@ 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(root_path=UVICORN_ROOT_PATH)
|
||||||
|
else:
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
|
|
Loading…
Reference in a new issue