From ef13dc9777ee60bc7c413c035971ca01a8864594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Thu, 18 Nov 2021 12:03:51 +0100 Subject: [PATCH] create python app --- app.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app.py diff --git a/app.py b/app.py new file mode 100644 index 0000000..c996019 --- /dev/null +++ b/app.py @@ -0,0 +1,18 @@ +from flask import Flask, jsonify +from multiprocessing import Value + + +counter = Value('i', 0) +app = Flask(__name__) + + +@app.route('/') +def index(): + with counter.get_lock(): + counter.value += 1 + out = counter.value + + return jsonify(count=out) + + +app.run(host="0.0.0.0", port=int("8080"), debug=False)