from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.config import settings app = FastAPI( title="KOL Insight API", description="KOL 视频数据查询与分析 API", version="1.0.0", ) # CORS 配置 app.add_middleware( CORSMiddleware, allow_origins=settings.CORS_ORIGINS, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) @app.get("/") async def root(): """Root endpoint.""" return {"message": "KOL Insight API", "version": "1.0.0"} @app.get("/health") async def health(): """Health check endpoint.""" return {"status": "healthy"}