create python app

This commit is contained in:
Torma Kristóf 2021-11-18 12:03:51 +01:00
parent 48d914ed5a
commit ef13dc9777

18
app.py Normal file
View File

@ -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)