fix example code in `READDME.md`

Commit 15436d0 · patx · 2025-06-19T21:04:28-04:00

Changeset
15436d0199bb216779da9be696e0260393dc631f
Parents
80d603213d9f1c5d8565ad34cd8887643f406109

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/README.md b/README.md
index 5c55fae..d26e90d 100644
--- a/README.md
+++ b/README.md
@@ -190,7 +190,7 @@ Built-in session handling simplifies state management:
 ```python
 class MyApp(App):
     async def index(self):
-        if "visits" not in self.session:
+        if "visits" not in self.request.session:
             self.request.session["visits"] = 1
         else:
             self.request.session["visits"] += 1
@@ -214,6 +214,7 @@ class MiddlewareExample(HttpMiddleware):
 
 class Root(App):
     async def index(self):
+        print("Hello, World!")
         return "Hello, World!"
 
 app = Root()