diff --git a/apps/socket/app.py b/apps/socket/app.py index 30412d0..8f8f910 100644 --- a/apps/socket/app.py +++ b/apps/socket/app.py @@ -19,7 +19,7 @@ async def test(): # 在这里添加你的test函数逻辑 return {"message": "test function executed"} -@app.all("/api/router") +@app.api_route("/api/router", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]) async def router(path: str = Query(...)): """路由处理器""" try: @@ -36,7 +36,7 @@ async def router(path: str = Query(...)): except Exception as e: return {"success": False, "error": str(e)} -@app.all("/") +@app.api_route("/", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]) async def root(): """健康检查端点""" return {"message": "FastAPI server is running"}