File size: 257 Bytes
f215f0a
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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)