assd / app.py
asv7j's picture
Update app.py
8c4cfc0 verified
raw
history blame
431 Bytes
# main.py
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
app = FastAPI()
templates = Jinja2Templates(directory="templates") # Create a Jinja2Templates object
@app.get("/", response_class=HTMLResponse)
async def read_root(request: Request):
# Render index.html template
return templates.TemplateResponse("index.html", {"request": request})