From e785b1c27e8c8bdc94fa0bec5db1586a6594b836fc0ec3e7b84592f19e18068d Mon Sep 17 00:00:00 2001 From: n Date: Tue, 4 Feb 2025 15:15:25 -0600 Subject: [PATCH] add post request for submitting toasts (pastes) --- src/toastbin/app.py | 4 ++++ src/toastbin/templates/new.j2 | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/src/toastbin/app.py b/src/toastbin/app.py index a2d69c7..55bb7e4 100644 --- a/src/toastbin/app.py +++ b/src/toastbin/app.py @@ -10,4 +10,8 @@ instance = config['instance']['domain'] def index(): return render_template('index.j2', instance=instance) +@app.route("/new", methods=['GET', 'POST']) +def new(): + return render_template('new.j2', instance=instance) + app.run(debug=True) diff --git a/src/toastbin/templates/new.j2 b/src/toastbin/templates/new.j2 index 6fffd22..16193a0 100644 --- a/src/toastbin/templates/new.j2 +++ b/src/toastbin/templates/new.j2 @@ -14,4 +14,13 @@

please follow the rules of {{ instance }}.

+
+ + +
+ +
+ + +