From 9b2151f7a96bc3a90b40e8d4b4477107e3b282d9 Mon Sep 17 00:00:00 2001 From: TylerCG <117808427+TylerCG@users.noreply.github.com> Date: Sun, 20 Apr 2025 19:01:57 -0400 Subject: [PATCH] update --- app/__pycache__/main.cpython-313.pyc | Bin 3201 -> 3332 bytes app/main.py | 10 ++++- app/templates/index.html | 60 +++++++++++++++++++++++++-- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/app/__pycache__/main.cpython-313.pyc b/app/__pycache__/main.cpython-313.pyc index ae69516b8d79a2ad897875fd1b351373eafb61d2..ec2aeea46772649ce3d58d9744ceaff47afad3ee 100644 GIT binary patch delta 428 zcmZpaY?0#o%*)Hg00h@-STmT|H}Yk3>azp6%|QG)0!Sz`C@@TA2xbgs3TD=03T6pr z1=DQ7>>yg7IgfF252t)RM+9RqXE2u@vndl$6A-8{m@}s_YI6JCV)e@}NiD8o)6WCZ znoLE!Kf%WTX~Vap;#rSzMWUDXA5D86~+n zRifdkIm!9CsR||e3ci&Jjs*n@9;Hc|!pucxKm%{FBo-7D-(oGvEXhfo{F_suo(U{o zWCfHg2DwZ@p-2X#kQHoZksXk&4U%&N5-%AV7(TEu2uUuGxX7V(Lr`Wx#6=Fh8-h{` ztbp_fc2*v?2A3~93_POOxm7Q6t1ienzJKrH~8<8PAy delta 286 zcmZpXYLw*r%*)Hg00dDLtQl@>8~L(1h1r1IW+47-10<9g6d0y5OkTk$AHW#O5X=*6$W$WG)7GpzbdZGyp+@my^NCFoGKZQ)SR4rg|wplTm`qp;u6OIPX%oS zugtuxL?cB_rXn+-&LSZoF*%Y;A%GFgFJ=Vt6^dklPO4pz`{oDS9E>uIjHQe-!ap;B=+DdyOxhorK+GaHpcVjy C3`L;; 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 %} +
+