Nhập môn FastAPI
Matt Eckerle
Software and Data Engineering Leader
FastAPI là cách nhanh để xây API hiệu năng cao bằng Python



pip install fastapi
main.pyfrom fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"message": "Hello World"}
fastapi dev main.py

Thay vào đó, định nghĩa mã máy chủ trong trình soạn thảo Python là main.py
Chạy từ terminal với lệnh
fastapi dev main.py
Application startup complete.Control + C trong cùng terminalNhập môn FastAPI