| """ |
| FastAPI应用主入口 |
| """ |
|
|
| from fastapi import FastAPI |
| from fastapi.middleware.cors import CORSMiddleware |
| from src.api.routes.communication import router as comm_router |
|
|
| app = FastAPI( |
| title="Human-Clone API", |
| description="Human-Clone系统通讯接口", |
| version="1.0.0" |
| ) |
|
|
| |
| app.add_middleware( |
| CORSMiddleware, |
| allow_origins=["*"], |
| allow_credentials=True, |
| allow_methods=["*"], |
| allow_headers=["*"], |
| ) |
|
|
| |
| app.include_router(comm_router, prefix="/api/v1") |
|
|
| @app.get("/") |
| async def root(): |
| return {"message": "Human-Clone API"} |
|
|
| @app.get("/health") |
| async def health_check(): |
| return {"status": "healthy"} |