Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -41,13 +41,14 @@ ALLOWED_STATIC = {
|
|
| 41 |
"Roboto-VariableFont_wdth,wght.ttf",
|
| 42 |
}
|
| 43 |
|
| 44 |
-
@app.
|
| 45 |
-
def
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
| 51 |
|
| 52 |
@app.get("/")
|
| 53 |
def index():
|
|
|
|
| 41 |
"Roboto-VariableFont_wdth,wght.ttf",
|
| 42 |
}
|
| 43 |
|
| 44 |
+
@app.route("/")
|
| 45 |
+
def index():
|
| 46 |
+
# Pobierz ostatnie notatki i pokaż w HTML
|
| 47 |
+
with engine.begin() as conn:
|
| 48 |
+
rows = conn.execute(text(
|
| 49 |
+
"SELECT id, body, created_at FROM notes ORDER BY id DESC LIMIT 20"
|
| 50 |
+
)).mappings().all()
|
| 51 |
+
return render_template("index.html", notes=rows)
|
| 52 |
|
| 53 |
@app.get("/")
|
| 54 |
def index():
|