ss / app.py
dog's picture
Upload . with huggingface_hub
950525a
raw
history blame
375 Bytes
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
app = FastAPI()
@app.get("/")
def home():
html_content = open('index.html').read()
return HTMLResponse(content=html_content, status_code=200)
@app.get("/hello")
def hello():
return {"hello": "world"}
@app.get("/hello/{name}")
def greet(name):
return {"greeting": f"Hello {name}!"}