21 lines
603 B
Python
21 lines
603 B
Python
# app.py 0.1.1 rise to factory mode
|
||
from bootstrap import bootstrap_paths
|
||
bootstrap_paths()
|
||
from apps import create_app
|
||
from apps.extensions import socketio
|
||
|
||
# 工厂创建 app,工厂里已经做了:加载配置/注册蓝图/注册 namespaces
|
||
app = create_app()
|
||
|
||
if __name__ == "__main__":
|
||
# 仅本地开发用;生产不要用 werkzeug 自带的开发服务器
|
||
socketio.run(
|
||
app,
|
||
host="0.0.0.0",
|
||
port=5551,
|
||
debug=True, # 开发期打开
|
||
allow_unsafe_werkzeug=True # 避免 dev server 的安全限制提示
|
||
)
|
||
|
||
|