updated
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user