mirror of
https://github.com/StefBuwalda/dashboard_test.git
synced 2025-10-30 11:19:58 +00:00
23 lines
472 B
Python
23 lines
472 B
Python
# import requests as r
|
|
from flask import jsonify, Flask
|
|
from poll_services import update_services
|
|
from mem import services
|
|
import threading
|
|
|
|
|
|
# Flask app to serve status
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route("/")
|
|
def status():
|
|
return jsonify([s.to_dict() for s in services])
|
|
|
|
|
|
# Only run if directly running file
|
|
if __name__ == "__main__":
|
|
threading.Thread(target=update_services, daemon=True).start()
|
|
|
|
# Run flask app
|
|
app.run(debug=True, use_reloader=False)
|