FastAPI
安裝 FastAPI 與伺服器
pip install fastapi
pip install "uvicorn[standard]"建立主程式 main.py
main.pyfrom fastapi import FastAPI
app = FastAPI()
@app.get("/")
def index():
return {"message": "Hello World", "year": 2025}啟動伺服器
使用說明
結語
Last updated