API remove some SETTINGS

This commit is contained in:
Jörn-Michael Miehe 2022-09-17 19:00:52 +00:00
parent 4f5e489950
commit bcc833d3a6
3 changed files with 4 additions and 8 deletions

View file

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

View file

@ -6,10 +6,9 @@ This file: Main API router definition.
from fastapi import APIRouter from fastapi import APIRouter
from ..settings import SETTINGS
from . import aggregate, calendar, image, misc, text, ticker from . import aggregate, calendar, image, misc, text, ticker
main_router = APIRouter(prefix=f"/{SETTINGS.api_prefix}") main_router = APIRouter(prefix="/api/v1")
main_router.include_router(misc.router) main_router.include_router(misc.router)

View file

@ -46,9 +46,6 @@ 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"
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"
redoc_url: Optional[str] = None if production_mode else "/redoc" redoc_url: Optional[str] = None if production_mode else "/redoc"