-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d3827f
commit 746db62
Showing
2 changed files
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import os | ||
from flask import Flask | ||
from flask_cors import CORS | ||
|
||
from .bp_api import api | ||
|
||
app = Flask(__name__) # 创建app | ||
app.config.from_object("www.settings.DevelopmentConfig") # 配制app | ||
|
||
# 配制app | ||
is_debug_mode = os.environ.get('FLASK_DEBUG', 'true').lower() == 'true' | ||
if is_debug_mode: app.config.from_object("www.settings.DevelopmentConfig") | ||
else: app.config.from_object("www.settings.ProductionConfig") | ||
|
||
app.register_blueprint(api, url_prefix='/api') # 注册蓝图api | ||
cors = CORS(app, supports_credentials=True) # 允许跨域 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters