From 8e5d418d8ee180f988169196f86b378301a26173 Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Sat, 16 Jan 2021 15:53:11 +0100 Subject: [PATCH] allow configuration of api url behind proxy --- src/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 1302707..5fcb30b 100644 --- a/src/main.py +++ b/src/main.py @@ -21,11 +21,12 @@ with open('version.json', 'r', encoding='UTF-8') as f: app = FastAPI(title=Constants.APP_NAME, version=VERSION['name'], - description='The StorageLeaf API') + description='The StorageLeaf API', + servers=[{'url': SETTINGS['api']['url'], 'description': f'{Constants.APP_NAME} API'}]) app.include_router(DeviceRouter.router) -@app.get("/") +@app.get('/') async def root(): return RedirectResponse(url='/docs') -- GitLab