From e8ea43124a3bb65e024135cb6e78ce9b8c5fd7ec Mon Sep 17 00:00:00 2001 From: Namonay Date: Thu, 19 Feb 2026 15:03:08 +0000 Subject: [PATCH] add: endpoint --- server/src/data/app.py | 9 ++++- .../data/{templates => template}/base.html | 3 +- server/src/data/template/index.html | 38 +++++++++++++++++++ server/src/data/templates/index.html | 29 -------------- 4 files changed, 46 insertions(+), 33 deletions(-) rename server/src/data/{templates => template}/base.html (94%) create mode 100644 server/src/data/template/index.html delete mode 100644 server/src/data/templates/index.html diff --git a/server/src/data/app.py b/server/src/data/app.py index 0d7d55e..423ab0b 100644 --- a/server/src/data/app.py +++ b/server/src/data/app.py @@ -1,8 +1,13 @@ -from flask import Flask, render_template +from flask import Flask, render_template, request, redirect app = Flask(__name__) @app.route("/") def mainpage(): items = ['dummy1', 'dummy2', 'a', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'] - return render_template('index.html', title='BG Shutdown') \ No newline at end of file + return render_template('index.html', title='BG Shutdown') +@app.route('/submit', methods =['POST']) +def submit(): + value = request.form.get("query") + print(value) + return redirect(url_for("mainpage")) \ No newline at end of file diff --git a/server/src/data/templates/base.html b/server/src/data/template/base.html similarity index 94% rename from server/src/data/templates/base.html rename to server/src/data/template/base.html index 5ee2f2d..6e1748f 100644 --- a/server/src/data/templates/base.html +++ b/server/src/data/template/base.html @@ -57,8 +57,7 @@ diff --git a/server/src/data/template/index.html b/server/src/data/template/index.html new file mode 100644 index 0000000..67b4af2 --- /dev/null +++ b/server/src/data/template/index.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} +{% block content %} + +
+ +
+
+
+ +
+
+ +
+
+
+ +
+ +
+ +
+ +{% endblock %} \ No newline at end of file diff --git a/server/src/data/templates/index.html b/server/src/data/templates/index.html deleted file mode 100644 index 1f86269..0000000 --- a/server/src/data/templates/index.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "base.html" %} -{% block content %} - -
- -
-
-
- -
-
- -
-
-
- -
-
    - {% for item in items %} -
  • - {{ item }} -
  • - {% endfor %} -
-
- -
- -{% endblock %} \ No newline at end of file