537
from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get("/")
def home():
return {"message": "@Beasteren // Your text"}
@app.get("/hello/{name}")
def hello(name: str):
return f"Namaste {name}!"
@app.get("/add/{a}/{b}")
def add(a: int, b: int):
result = a + b
return f"{a} + {b} = {result}"
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)04 jun, 05:39
