This commit is contained in:
Adriankf59
2026-04-26 18:15:38 +07:00
parent 002821ca07
commit 5d9d9f784a
2 changed files with 5 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ class Settings(BaseSettings):
app_host: str = "0.0.0.0"
app_port: int = 8000
app_log_level: str = "INFO"
root_path: str = "" # For reverse proxy with path prefix (e.g., "/ocr")
# Storage (Phase 1: local fs)
storage_local_dir: Path = Path("./storage")

View File

@@ -30,6 +30,9 @@ def create_app() -> FastAPI:
configure_logging(settings.app_log_level)
_ensure_schema()
# Support for reverse proxy with path prefix (e.g., /ocr)
root_path = getattr(settings, "root_path", "")
app = FastAPI(
title="OCR Sprint Service",
version=__version__,
@@ -37,6 +40,7 @@ def create_app() -> FastAPI:
docs_url="/docs",
redoc_url="/redoc",
openapi_url="/openapi.json",
root_path=root_path,
)
register_error_handlers(app)