目录

一、使用Pycharm创建FastAPI项目

二、 添加启动函数

三、启动项目

四、访问接口文档 


一、使用Pycharm创建FastAPI项目

FastAPI(一)创建项目_ico

FastAPI(一)创建项目_接口文档_02

二、 添加启动函数

if __name__ == "__main__":
    uvicorn.run("main:app", host="0.0.0.0", port=8080)

FastAPI(一)创建项目_接口文档_03

 

三、启动项目

FastAPI(一)创建项目_fastapi_04

四、访问接口文档 

http://localhost:8080/docs

 

FastAPI(一)创建项目_fastapi_05