# FastAPIProject **Repository Path**: rambohoo/fast-apiproject ## Basic Information - **Project Name**: FastAPIProject - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-24 - **Last Updated**: 2026-06-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 方式 1:终端命令启动(推荐开发用,带热重载) 打开项目文件夹终端执行 d:\ProgramData\anaconda3\python.exe -m uvicorn main:app --reload main:文件名 main.py app:文件里 app = FastAPI() 实例变量名 方式 2:在 main.py 末尾加启动代码,直接运行 py 文件 # 新增启动入口 from fastapi import FastAPI import uvicorn # 创建 FastAPI 实例 app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World888"} # 访问 /hello 响应结果 msg: 你好 FastAPI @app.get("/hello") async def get_hello(): return {"msg": "你好 FastAPI"} # 新增启动入口 if __name__ == "__main__": uvicorn.run("01-路由:app", host="127.0.0.1", port=8000, reload=True)