app factory

This commit is contained in:
John Lancaster
2026-07-21 08:49:36 -05:00
parent 7970e76d4f
commit 27f783fc90
3 changed files with 48 additions and 33 deletions
+6 -9
View File
@@ -1,14 +1,14 @@
from fastapi import FastAPI
from personal_mcp.config import Settings
from personal_mcp.config import get_settings
from personal_mcp.mcp import mcp
from personal_mcp.web.docs_mount import mount_docs_static
from personal_mcp.web.health import router as health_router
from ..config import Settings
from ..config import get_settings
from ..mcp import mcp
from .docs_mount import mount_docs_static
from .health import router as health_router
def create_app(settings: Settings | None = None) -> FastAPI:
runtime_settings = settings or get_settings()
runtime_settings = settings if settings is not None else get_settings()
mcp_app = mcp.http_app(
path=runtime_settings.mounts.mcp,
json_response=True,
@@ -32,6 +32,3 @@ def create_app(settings: Settings | None = None) -> FastAPI:
)
app.mount("/", mcp_app, name="mcp")
return app
app = create_app()