updated
This commit is contained in:
@@ -24,6 +24,7 @@ class Settings(BaseSettings):
|
|||||||
app_host: str = "0.0.0.0"
|
app_host: str = "0.0.0.0"
|
||||||
app_port: int = 8000
|
app_port: int = 8000
|
||||||
app_log_level: str = "INFO"
|
app_log_level: str = "INFO"
|
||||||
|
root_path: str = "" # For reverse proxy with path prefix (e.g., "/ocr")
|
||||||
|
|
||||||
# Storage (Phase 1: local fs)
|
# Storage (Phase 1: local fs)
|
||||||
storage_local_dir: Path = Path("./storage")
|
storage_local_dir: Path = Path("./storage")
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ def create_app() -> FastAPI:
|
|||||||
configure_logging(settings.app_log_level)
|
configure_logging(settings.app_log_level)
|
||||||
_ensure_schema()
|
_ensure_schema()
|
||||||
|
|
||||||
|
# Support for reverse proxy with path prefix (e.g., /ocr)
|
||||||
|
root_path = getattr(settings, "root_path", "")
|
||||||
|
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="OCR Sprint Service",
|
title="OCR Sprint Service",
|
||||||
version=__version__,
|
version=__version__,
|
||||||
@@ -37,6 +40,7 @@ def create_app() -> FastAPI:
|
|||||||
docs_url="/docs",
|
docs_url="/docs",
|
||||||
redoc_url="/redoc",
|
redoc_url="/redoc",
|
||||||
openapi_url="/openapi.json",
|
openapi_url="/openapi.json",
|
||||||
|
root_path=root_path,
|
||||||
)
|
)
|
||||||
|
|
||||||
register_error_handlers(app)
|
register_error_handlers(app)
|
||||||
|
|||||||
Reference in New Issue
Block a user