mano96/Fast-API
0
1from fastapi import FastAPI2from fastapi.responses import HTMLResponse3 4app = FastAPI()5 6 7@app.get("/")8def home():9 html_content = open('index.html').read()10 return HTMLResponse(content=html_content, status_code=200)11 12 13@app.get("/hello")14def hello():15 return {"hello": "world"}16 17 18@app.get("/hello/{name}")19def greet(name):20 return {"greeting": f"Hello {name}!"}