first / api.py
huaqianshu_z
Add application file
f215f0a
raw
history blame contribute delete
257 Bytes
from fastapi import FastAPI
app = FastAPI()
@app.get("/api/square/{value}")
def read_square(value: int):
return {"value": value, "squared": value * value}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)