Antoni09 commited on
Commit
027a7d6
·
verified ·
1 Parent(s): db00c26

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +7 -2
server.py CHANGED
@@ -251,8 +251,13 @@ def require_auth() -> str:
251
 
252
 
253
  @app.route("/")
254
- def serve_index() -> Any:
255
- return send_from_directory(app.static_folder, "index.html")
 
 
 
 
 
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>")