From 8a131c1b7bf6395a198a2b7d2c5c10b8c0f0c7a1 Mon Sep 17 00:00:00 2001 From: lookerzz <1031516901@qq.com> Date: Sun, 20 Sep 2026 17:06:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/example.py | 8 ++++++++ main.py | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 api/example.py diff --git a/api/example.py b/api/example.py new file mode 100644 index 0000000..97f9a8e --- /dev/null +++ b/api/example.py @@ -0,0 +1,8 @@ +#这是一个示例文件,确保api端口能被正常调用 +from fastapi import APIRouter + +example_router = APIRouter() + +@example_router.get("/example") +def example(): + return {'hello DoubaoTeam'} \ No newline at end of file diff --git a/main.py b/main.py index e69de29..235d211 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,17 @@ +from fastapi import FastAPI +from api.example import example_router +import uvicorn +app = FastAPI() + +#-------------张昕浩--------------- +app.include_router(example_router) + + + + + + +#-----------主程序---------------- + +if __name__ == "__main__": + uvicorn.run(app, host="0.0.0.0", port=23333) \ No newline at end of file