This commit is contained in:
2025-10-17 00:09:26 +02:00
parent 2aa8d98aa1
commit aa033aafbe
15 changed files with 357 additions and 0 deletions

20
flask_backend/app.py Normal file
View File

@@ -0,0 +1,20 @@
from flask import Flask, request, jsonify
from Sender import send_to_queue
app = Flask(__name__)
@app.route("/send", methods=["POST"])
def send():
# očekává JSON payload
payload = request.get_json()
if not payload:
return jsonify({"error": "No JSON payload provided"}), 400
try:
send_to_queue(payload) # voláme funkci z sender.py
return jsonify({"status": "ok"}), 200
except Exception as e:
return jsonify({"error": str(e)}), 500
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)