SETTINGS.main_{host,port}

This commit is contained in:
Jörn-Michael Miehe 2022-09-09 02:41:42 +00:00
parent f36272a6c0
commit 3926729e0c
2 changed files with 4 additions and 2 deletions

View file

@ -40,8 +40,8 @@ def main() -> None:
if webdav_check(): if webdav_check():
uvicorn_run( uvicorn_run(
app="ovdashboard_api.main:app", app="ovdashboard_api.main:app",
host="0.0.0.0", host=SETTINGS.main_host,
port=8000, port=SETTINGS.main_port,
reload=not SETTINGS.production_mode, reload=not SETTINGS.production_mode,
) )

View file

@ -56,6 +56,8 @@ class Settings(BaseSettings):
ping_host: str = "10.0.0.0" ping_host: str = "10.0.0.0"
ping_port: int = 1 ping_port: int = 1
main_host: str = "0.0.0.0"
main_port: int = 8000
api_prefix: str = "api/v1" api_prefix: str = "api/v1"
openapi_url: str = "/openapi.json" openapi_url: str = "/openapi.json"
docs_url: Optional[str] = None if production_mode else "/docs" docs_url: Optional[str] = None if production_mode else "/docs"