-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathapp.py
More file actions
34 lines (25 loc) · 773 Bytes
/
app.py
File metadata and controls
34 lines (25 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
from flask import Flask, render_template, jsonify
from get_bigquery_data import get_fault_trigger_counts, get_fault_trigger_avg_duration, get_descriptions
import json
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/get_trigger_counts')
def get_trigger_counts():
data = get_fault_trigger_counts()
return jsonify(data)
@app.route('/get_trigger_avg_duration')
def get_trigger_avg_duration():
data = get_fault_trigger_avg_duration()
return jsonify(data)
@app.route("/get_descriptions")
def get_descriptions_cnts():
data = get_descriptions()
return jsonify(data)
@app.route("/live")
def live_analytics():
return render_template("index.html")
if __name__ == '__main__':
app.run(debug=True)