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