diff --git a/src/main.py b/src/main.py index 59dc158..f319a73 100644 --- a/src/main.py +++ b/src/main.py @@ -9,14 +9,18 @@ from src.core.exceptions import ( chunking_exception_handler, benchmark_exception_handler, ) +from src.documents.routes import router as documents_router +from src.storage.sqlite import init_db def create_app() -> FastAPI: """Create and configure the FastAPI application. Mounts domain routers and registers exception handlers. - Routers are imported lazily — domains are added in later phases. """ + # Ensure SQLite tables exist at startup + init_db() + app = FastAPI( title="RAG Chunking Benchmarker", description="Benchmark five chunking strategies on regulatory documents. " @@ -37,6 +41,9 @@ def create_app() -> FastAPI: app.add_exception_handler(ChunkingError, chunking_exception_handler) app.add_exception_handler(BenchmarkError, benchmark_exception_handler) + # Mount domain routers + app.include_router(documents_router) + return app