forked from innovacion/Mayacontigo
30 lines
443 B
Python
30 lines
443 B
Python
from contextlib import asynccontextmanager
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from api import config
|
|
|
|
from .v1 import router
|
|
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(_: FastAPI):
|
|
await config.init_mongo_db()
|
|
config.init_langfuse()
|
|
yield
|
|
|
|
|
|
app = FastAPI(
|
|
lifespan=lifespan,
|
|
docs_url="/api/docs",
|
|
openapi_url="/api/openapi.json",
|
|
)
|
|
|
|
|
|
@app.get("/")
|
|
async def health():
|
|
return {"status": "ok"}
|
|
|
|
|
|
app.include_router(router)
|