Pay-then-profile join desk with live card, S3 upload fallback, hydration-safe drafts; document on test9 README. Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
"""Nomadro coffeechat booking API — Cal.com-domain secondary-dev."""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
ROOT = Path(__file__).resolve().parent
|
|
SERVICES = ROOT / "services"
|
|
sys.path.insert(0, str(ROOT))
|
|
sys.path.insert(0, str(SERVICES))
|
|
|
|
from coffee_svc.config import COFFEE_ENABLED # noqa: E402
|
|
from coffee_svc.routers import router as coffee_router # noqa: E402
|
|
from coffee_svc.store import init_db # noqa: E402
|
|
|
|
app = FastAPI(title="nomadro-coffee", docs_url="/docs", redoc_url=None)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
@app.on_event("startup")
|
|
def _startup() -> None:
|
|
if COFFEE_ENABLED:
|
|
init_db()
|
|
|
|
|
|
if COFFEE_ENABLED:
|
|
app.include_router(coffee_router, prefix="/api/coffee/v1")
|
|
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {"ok": True, "service": "nomadro-coffee", "coffee": bool(COFFEE_ENABLED)}
|