Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -251,8 +251,13 @@ def require_auth() -> str:
|
|
| 251 |
|
| 252 |
|
| 253 |
@app.route("/")
|
| 254 |
-
def
|
| 255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
|
| 257 |
|
| 258 |
@app.route("/<path:path>")
|
|
|
|
| 251 |
|
| 252 |
|
| 253 |
@app.route("/")
|
| 254 |
+
def index():
|
| 255 |
+
# Pobierz ostatnie notatki i pokaż w HTML
|
| 256 |
+
with engine.begin() as conn:
|
| 257 |
+
rows = conn.execute(text(
|
| 258 |
+
"SELECT id, body, created_at FROM notes ORDER BY id DESC LIMIT 20"
|
| 259 |
+
)).mappings().all()
|
| 260 |
+
return render_template("index.html", notes=rows)
|
| 261 |
|
| 262 |
|
| 263 |
@app.route("/<path:path>")
|