AIdea-Server / main.py
Ali Hashhash
feat: implement asynchronous YouTube note generation pipeline and API endpoints
f89dbd6
raw
history blame contribute delete
538 Bytes
from contextlib import asynccontextmanager
from fastapi import FastAPI
@asynccontextmanager
async def lifespan(app: FastAPI):
# الجزء ده بيتنفذ أول ما السيرفر يفتح
print("🚀 AIdea API starting up...")
yield
# الجزء ده بيتنفذ لما السيرفر يقفل
print("🛑 AIdea API shutting down...")
# تعريف الـ app مع إضافة الـ lifespan
app = FastAPI(lifespan=lifespan)
# ... باقي الـ Routes بتاعتك (auth, notes, etc.) تفضل زي ما هي