aboutsummaryrefslogtreecommitdiffstats
path: root/docker/flask_app/flask_app.py
diff options
context:
space:
mode:
authorEmma Foley <efoley@redhat.com>2021-04-21 19:59:52 +0100
committerEmma Foley <efoley@redhat.com>2021-12-17 09:48:20 +0000
commitc79ce380d9f8d3e582a1e7b13e1ce116312f5c64 (patch)
tree18b739b457fe7caee0919a2d433c87ca74bce242 /docker/flask_app/flask_app.py
parentd6865dee56b4648727943b9528ea86ddc4485310 (diff)
Create a flask app to show metrics from collectd
Change-Id: Ief2e99d551809705c0b246a7cae5bd5804f97137 Signed-off-by: Emma Foley <efoley@redhat.com>
Diffstat (limited to 'docker/flask_app/flask_app.py')
-rw-r--r--docker/flask_app/flask_app.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/docker/flask_app/flask_app.py b/docker/flask_app/flask_app.py
new file mode 100644
index 00000000..771a91bc
--- /dev/null
+++ b/docker/flask_app/flask_app.py
@@ -0,0 +1,16 @@
+from flask import Flask, request
+import json
+
+app = Flask(__name__)
+
+@app.route('/', methods=['GET', 'POST'])
+def get_data():
+ #print(request.data)
+ #print(type(request.data))
+ print(request.data.decode('utf-8'))
+ #print(json.loads(request.data.decode("utf-8")))
+
+ return 'This is working!'
+
+if __name__=='__main__':
+ app.run(debug=True, host='0.0.0.0')