Skip to content

Commit

Permalink
✨ feat: 测试本地环境是否影响线上
Browse files Browse the repository at this point in the history
  • Loading branch information
nichuanfang committed Dec 11, 2023
1 parent 0c07c4b commit a4db162
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
15 changes: 11 additions & 4 deletions core/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
# 导出所有components下__init__.py的蓝图文件


def init(app: Flask, debug: bool = False):

def mount(app: Flask):
# 挂载蓝图
for blueprint in blueprints:
app.register_blueprint(blueprint)
# 项目启动
# app.run(debug=debug)


def run(app: Flask, debug: bool = False):
"""本地启动项目
Args:
app (Flask): _description_
debug (bool, optional): _description_. Defaults to False.
"""
app.run(debug=debug)
5 changes: 4 additions & 1 deletion index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
# 允许跨域
CORS(app)
# 挂载路由 启动项目
bootstrap.init(app=app)
bootstrap.mount(app=app)

if __name__ == '__main__':
bootstrap.run(app)

0 comments on commit a4db162

Please sign in to comment.