The flask app now provides test data.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 30 May 2018 21:39:13 +0000 (23:39 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 30 May 2018 21:39:13 +0000 (23:39 +0200)
web/seepark_web.py

index 9ff09e0121f814307824ebca321d39287f732a29..fd6f7851607cf3752126718b711901cec8a86473 100644 (file)
@@ -1,6 +1,17 @@
-from flask import Flask, render_template
+from flask import Flask, render_template, jsonify
 app = Flask(__name__)
 
+@app.route("/data")
+def data():
+    data = {
+        'water_temperature': [20, 19, 20, 21, 20],
+        'water_temperature_x': ['2018-05-20', '2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24'],
+        'air_temperature': [27, 32, 26, 29, 30],
+        'air_temperature_x': ['2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-25'],
+        }
+    return jsonify(data)
+
+
 @app.route("/")
 def hello():
     return render_template('seepark_web.html')