moved templates

This commit is contained in:
Kristjan Komlosi
2020-07-13 13:23:24 +02:00
parent 16d7624154
commit a4ec93f412
40 changed files with 1 additions and 20689 deletions
+20
View File
@@ -0,0 +1,20 @@
# app.py - main backend program
'''Main TeraHz backend program'''
# All code in this file is licensed under the ISC license, provided in LICENSE.txt
from flask import Flask, jsonify
import sensors
app = Flask(__name__)
@app.route('/data')
def sendData():
'''Responder function for /data route'''
s = sensors.Spectrometer(path='/dev/serial0')
u = sensors.UVSensor()
l = sensors.LxMeter()
response = jsonify([s.getData(), l.getData(), u.getABI()])
response.headers.add('Access-Control-Allow-Origin', '*')
return response
@app.route('/')
def renderTable()
return render_template('index.html')