File size: 672 Bytes
82f9be0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
"""
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"
)

# CORS中间件
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"}