made everything static
This commit is contained in:
20
app.py
20
app.py
@ -1,20 +0,0 @@
|
|||||||
from flask import Flask, jsonify, render_template
|
|
||||||
from monitor.node import check_network_health, measure_latency, check_bandwidth
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
@app.route('/')
|
|
||||||
def index():
|
|
||||||
return render_template('index.html')
|
|
||||||
|
|
||||||
@app.route('/api/metrics')
|
|
||||||
def get_metrics():
|
|
||||||
metrics = {
|
|
||||||
'network_health': check_network_health(),
|
|
||||||
'latency': measure_latency(),
|
|
||||||
'bandwidth': check_bandwidth()
|
|
||||||
}
|
|
||||||
return jsonify(metrics)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
app.run(debug=True)
|
|
||||||
Reference in New Issue
Block a user