-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (21 loc) · 759 Bytes
/
main.py
File metadata and controls
25 lines (21 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import logging
from contextlib import asynccontextmanager
from fastapi import FastAPI
from .memoryalpha.health import router as health_router
from .memoryalpha.ask import router as ask_router
from .memoryalpha.identify import router as identify_router
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@asynccontextmanager
async def lifespan(app: FastAPI):
# Startup
logger.info("FastAPI application starting up...")
logger.info("Health and stream endpoints available")
yield
# Shutdown (if needed)
logger.info("FastAPI application shutting down...")
app = FastAPI(lifespan=lifespan)
app.include_router(health_router)
app.include_router(ask_router)
app.include_router(identify_router)