from flask import Flask, render_template, send_from_directory app = Flask(__name__) @app.route("/") def hello_world(): return render_template('index.html') @app.route("/calibration") def calibration(): return render_template('calibration.html') @app.route("/api/calibration-data") def calibration_data(): return { 'leds': [ {'name': 'led_0010', 'position': [4.7568647, -7.99294013, 7.96453843]}, {'name': 'led_0020', 'position': [-2.72752819, -9.82011953, 9.24452802]}, {'name': 'led_0030', 'position': [-7.71848326, -3.84971189, 8.54659339]}, {'name': 'led_0040', 'position': [-5.50536593, 8.13132868, 10.61159615]}, {'name': 'led_0050', 'position': [3.2939535, 9.13207673, 8.55962855]}, {'name': 'led_0060', 'position': [9.95077473, 3.18431267, 10.01643023]}, {'name': 'led_0070', 'position': [4.80205465, -4.56261438, 4.56638023]}, {'name': 'led_0080', 'position': [-3.37632619, -7.72890365, 6.26207315]}, {'name': 'led_0090', 'position': [-7.05810901, 3.15661764, 6.64505902]} ], 'spheres': [ [0.30415745, -0.17907307, 16.7683142], [3.98316763, 3.44079019, 17.03800586], [-2.83333147, 4.22778253, 16.95089368], [2.88769696, -4.29023411, 16.96762258], [-2.48223398, -4.19363008, 16.89485543], ], } @app.route('/static/') def send_static(path): return send_from_directory('static', path) @app.route('/data/') def send_data(path): return send_from_directory('data', path)