Spaces:
Runtime error
Runtime error
from fastapi import FastAPI, Request | |
from fastapi.responses import HTMLResponse | |
from fastapi.staticfiles import StaticFiles | |
from fastapi.templating import Jinja2Templates | |
import uvicorn | |
app = FastAPI() | |
# Mount static files directory | |
app.mount("/static", StaticFiles(directory="static"), name="static") | |
# Setup templates | |
templates = Jinja2Templates(directory="templates") | |
async def home(request: Request): | |
return templates.TemplateResponse( | |
"index.html", | |
{"request": request} | |
) | |
if __name__ == "__main__": | |
uvicorn.run(app, host="0.0.0.0", port=7860) |