mirror of
https://github.com/StefBuwalda/dashboard_test.git
synced 2025-10-29 18:59:59 +00:00
MAJOR REFACTOR P2
This commit is contained in:
20
app/flask_app/__init__.py
Normal file
20
app/flask_app/__init__.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import threading
|
||||
from flask import Flask
|
||||
|
||||
stop_event = threading.Event()
|
||||
|
||||
# Flask app to serve status
|
||||
app = Flask(__name__)
|
||||
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///app.db"
|
||||
|
||||
|
||||
def start_flask() -> None:
|
||||
try:
|
||||
# Run flask app
|
||||
from .routes import bp
|
||||
|
||||
app.register_blueprint(bp)
|
||||
app.run(host="0.0.0.0", port=80, debug=True, use_reloader=False)
|
||||
except Exception as e:
|
||||
print("Worker thread exception:", e)
|
||||
stop_event.set()
|
||||
Reference in New Issue
Block a user