summaryrefslogtreecommitdiff
path: root/templates/api.py
diff options
context:
space:
mode:
authornasrlol <nsrddyn@gmail.com>2024-11-27 00:54:43 +0100
committernasrlol <nsrddyn@gmail.com>2024-11-27 00:54:43 +0100
commitdf6d2c51b15d55a30b8515de637aa7af490b2d95 (patch)
tree25afa36b2be61783997eb59633e9c7e4aff438b7 /templates/api.py
parent4e86a2ee9f5578cbaae6cc7dd52616e3e3751764 (diff)
small modifications to the file system
Diffstat (limited to 'templates/api.py')
-rw-r--r--templates/api.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/templates/api.py b/templates/api.py
deleted file mode 100644
index b04ef77..0000000
--- a/templates/api.py
+++ /dev/null
@@ -1,27 +0,0 @@
1from flask import Flask, request, jsonify, render_template
2
3app = Flask(__name__)
4
5
6@app.route("/")
7def index():
8 return render_template("index.html")
9
10
11@app.route("/api/run-script", methods=["POST"])
12def run_script():
13 data = request.json
14 if not data:
15 return jsonify({"error": "No data provided"}), 400
16
17 script_result = my_script_logic(data.get("input"))
18
19 return jsonify({"result": script_result})
20
21
22def my_script_logic(input_value):
23 return f"Processed input: {input_value}"
24
25
26if __name__ == "__main__":
27 app.run(host="0.0.0.0", port=5000, debug=True)