Update: save Docker nginx Angular Node Flask
This commit is contained in:
parent
1a3bee1846
commit
fcedd7534c
16 changed files with 89 additions and 84 deletions
|
|
@ -1,23 +0,0 @@
|
|||
from flask import Flask
|
||||
from flask_cors import CORS
|
||||
|
||||
|
||||
def create_app(flask_env='development'):
|
||||
app = Flask(__name__, instance_relative_config=False, static_url_path='')
|
||||
origin = app.config.get('ALLOW_ORIGIN')
|
||||
if origin is None:
|
||||
origin = ['http://127.0.0.1:4200', 'http://localhost:4200']
|
||||
CORS(app, supports_credentials=True, origins=origin)
|
||||
if flask_env == 'production':
|
||||
app.config.from_object("config.ProductionConfig")
|
||||
elif flask_env == 'testing':
|
||||
app.config.from_object("config.TestingConfig")
|
||||
elif flask_env == 'development':
|
||||
app.config.from_object("config.DevelopmentConfig")
|
||||
else:
|
||||
app.config.from_object("config.Config")
|
||||
|
||||
with app.app_context():
|
||||
from . import routes
|
||||
app.register_blueprint(routes.bp)
|
||||
return app
|
||||
Loading…
Add table
Add a link
Reference in a new issue