refactor(server): adopt uv and modular typed FastAPI structure
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""Assemble the client API and retain its existing documentation URLs."""
|
||||
|
||||
import os
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import RedirectResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from s2s_client.api.router import router
|
||||
from s2s_client.core import config, diagnostics # noqa: F401 - retain the startup banner
|
||||
|
||||
app = FastAPI(title="s2s-demo")
|
||||
app.include_router(router)
|
||||
|
||||
|
||||
@app.get("/project", include_in_schema=False)
|
||||
@app.get("/project/", include_in_schema=False)
|
||||
@app.get("/project/index.html", include_in_schema=False)
|
||||
@app.get("/public/docs.html", include_in_schema=False)
|
||||
async def project_documentation() -> RedirectResponse:
|
||||
return RedirectResponse("/docs/proposals/vocero-architecture.html", status_code=307)
|
||||
|
||||
|
||||
# The existing FastAPI /docs page remains registered ahead of this mount.
|
||||
app.mount("/docs", StaticFiles(directory=os.path.join(config.ROOT_DIR, "docs"), html=True), name="documentation")
|
||||
Reference in New Issue
Block a user