mirror of
https://github.com/bleak-ai/gcontext.git
synced 2026-08-11 13:19:23 +02:00
FastAPI + Postgres service that stores workflow templates as file bundles with indexed manifest fields, submit-for-review publishing, and moderation endpoints behind an admin token. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
491 B
Python
24 lines
491 B
Python
from contextlib import asynccontextmanager
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from .db import init_db
|
|
from .routes_moderation import router as moderation_router
|
|
from .routes_public import router as public_router
|
|
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(app: FastAPI):
|
|
init_db()
|
|
yield
|
|
|
|
|
|
app = FastAPI(title="gcontext workflows API", lifespan=lifespan)
|
|
app.include_router(public_router)
|
|
app.include_router(moderation_router)
|
|
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {"status": "ok"}
|