重构后端成功
This commit is contained in:
@@ -17,12 +17,25 @@ for logger_name in ['uvicorn', 'uvicorn.access', 'fastapi']:
|
||||
|
||||
# backend/app/main.py
|
||||
from fastapi import FastAPI
|
||||
from .api.route import router
|
||||
try:
|
||||
from backend.api.route import router
|
||||
except ImportError:
|
||||
from api.route import router
|
||||
app = FastAPI(title="LLM Workflow Engine")
|
||||
|
||||
# 注册路由
|
||||
app.include_router(router, prefix="/api")
|
||||
|
||||
# 添加健康检查端点
|
||||
@app.get("/health")
|
||||
async def health_check():
|
||||
return {"status": "healthy"}
|
||||
|
||||
# 添加根路径
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"message": "LLM Workflow Engine", "status": "running"}
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
|
||||
Reference in New Issue
Block a user