clone / src /main.py
tanbushi's picture
update
82f9be0
raw
history blame contribute delete
672 Bytes
"""
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"}