from fastapi import FastAPI
app=FastAPI()
@app.get("/")
def hello_world():
return "Hello, World!"
终端中输入uvicorn test:app --reload ######test为本py文件名字
点击终端弹出的http://127.0.0.1:8000,打开网页
from fastapi import FastAPI
app=FastAPI()
@app.get("/")
def hello_world():
return "Hello, World!"
终端中输入uvicorn test:app --reload ######test为本py文件名字
点击终端弹出的http://127.0.0.1:8000,打开网页