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 notify API — Novu-domain workflows + inbox (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 notify_svc.config import NOTIFY_ENABLED # noqa: E402
|
|
from notify_svc.routers import router as notify_router # noqa: E402
|
|
from notify_svc.store import init_db # noqa: E402
|
|
|
|
app = FastAPI(title="nomadro-notify", 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 NOTIFY_ENABLED:
|
|
init_db()
|
|
|
|
|
|
if NOTIFY_ENABLED:
|
|
app.include_router(notify_router, prefix="/api/notify/v1")
|
|
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {"ok": True, "service": "nomadro-notify", "notify": bool(NOTIFY_ENABLED)}
|