diff --git a/app/__pycache__/main.cpython-313.pyc b/app/__pycache__/main.cpython-313.pyc index ae69516..ec2aeea 100644 Binary files a/app/__pycache__/main.cpython-313.pyc and b/app/__pycache__/main.cpython-313.pyc differ diff --git a/app/main.py b/app/main.py index 7b0ec97..b7c5737 100644 --- a/app/main.py +++ b/app/main.py @@ -41,5 +41,11 @@ async def ydl(url: str, location: str): # html @app.get("/", response_class=HTMLResponse) -async def read_root(request: Request): - return templates.TemplateResponse("index.html", {"request": request, "message": "Hello from FastAPI + Jinja2!"}) +async def index(request: Request): + apps = [ + {"name": "Notes", "url": "/notes"}, + {"name": "Todo List", "url": "/todos"}, + {"name": "Weather", "url": "/weather"}, + # Add more apps here + ] + return templates.TemplateResponse("index.html", {"request": request, "apps": apps, "title": "Welcome to My App Hub"}) \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index 81cc744..e306336 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,9 +1,63 @@ - + - FastAPI with Jinja2 + + {{ title or "My Apps" }} + + -

{{ message }}

+
+

{{ title or "My Apps" }}

+
+ {% for app in apps %} + + {% endfor %} +
+