Update: Cors Origin from Docker Environments
This commit is contained in:
parent
a398b49a98
commit
3615ae8d3b
3 changed files with 9 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from flask import current_app as app
|
||||
from flask import request, Blueprint
|
||||
from flask_cors import CORS
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
|
@ -7,7 +8,10 @@ from .api_functions import db_login, db_register, db_user_update, db_create_log,
|
|||
from .sessionJWT import create_auth_token, check_auth_token
|
||||
|
||||
bp = Blueprint('myapp', __name__)
|
||||
CORS(bp, supports_credentials=True, origins=['http://127.0.0.1:4200', 'http://localhost:4200'])
|
||||
origin = app.config.get('ALLOW_ORIGIN')
|
||||
if origin is None:
|
||||
origin = ['http://127.0.0.1:4200', 'http://localhost:4200']
|
||||
CORS(bp, supports_credentials=True, origins=origin)
|
||||
|
||||
|
||||
@bp.app_errorhandler(HTTPException)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue