M35: harden the shared public demo

This commit is contained in:
NuklearRabbit
2026-08-10 22:32:58 +02:00
parent c7492bf6ad
commit 809ba0ddcc
9 changed files with 142 additions and 22 deletions
+10 -1
View File
@@ -55,7 +55,15 @@ async def lifespan(_app: FastAPI):
stop_background_dispatcher()
app = FastAPI(title=f"{PRODUCT_NAME} API", version="0.1.0", lifespan=lifespan)
production = settings.mobilityops_env.lower() == "production"
app = FastAPI(
title=f"{PRODUCT_NAME} API",
version="0.1.0",
lifespan=lifespan,
docs_url=None if production else "/docs",
redoc_url=None if production else "/redoc",
openapi_url=None if production else "/openapi.json",
)
app.add_middleware(
SessionMiddleware,
@@ -126,6 +134,7 @@ def handle_http_exception(request: Request, exc: HTTPException) -> JSONResponse:
correlation_id=getattr(request.state, "correlation_id", str(uuid.uuid4())),
details={},
),
headers=exc.headers,
)