This commit is contained in:
beabigegg
2025-09-12 11:50:43 +08:00
parent 0bc8c4c81c
commit ed9250db1a
7 changed files with 230 additions and 279 deletions

View File

@@ -138,6 +138,13 @@ def create_app(config_name=None):
# 初始化 WebSocket
from app.websocket import init_websocket
app.socketio = init_websocket(app)
# 註冊 Root 路由(提供 SPA 與基本 API 資訊)
try:
from app.root import root_bp
app.register_blueprint(root_bp)
except Exception as e:
app.logger.warning(f"Root routes not registered: {e}")
app.logger.info("Flask application created successfully")
return app
@@ -215,4 +222,4 @@ def create_default_admin():
print(f"Failed to create default admin: {str(e)}")
# 導入模型在需要時才進行,避免循環導入
# 導入模型在需要時才進行,避免循環導入