mirror of
https://github.com/StefBuwalda/dashboard_test.git
synced 2025-10-30 11:19:58 +00:00
25 lines
485 B
Python
25 lines
485 B
Python
# import requests as r
|
|
from flask import jsonify, Flask
|
|
from poll_services import start_async_loop
|
|
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__":
|
|
|
|
t = threading.Thread(target=start_async_loop, daemon=True)
|
|
t.start()
|
|
|
|
# Run flask app
|
|
app.run(debug=True, use_reloader=False)
|