Merge remote-tracking branch 'origin/testing' into feature/navigation

This commit is contained in:
Dan Funk 2020-05-16 15:46:14 -04:00
commit fafdf56ad2
3 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@ basedir = os.path.abspath(os.path.dirname(__file__))
JSON_SORT_KEYS = False # CRITICAL. Do not sort the data when returning values to the front end.
NAME = "CR Connect Workflow"
FLASK_PORT = environ.get('PORT0') or environ.get('FLASK_PORT', default="5000")
CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default="localhost:4200, localhost:5002"))
DEVELOPMENT = environ.get('DEVELOPMENT', default="true") == "true"
TESTING = environ.get('TESTING', default="false") == "true"

View File

@ -40,9 +40,7 @@ connexion_app.add_api('api.yml')
# Convert list of allowed origins to list of regexes
origins_re = [r"^https?:\/\/%s(.*)" % o.replace('.', '\.') for o in app.config['CORS_ALLOW_ORIGINS']]
logging.getLogger('flask_cors').level = logging.DEBUG
cors = CORS(connexion_app.app)
# cors = CORS(connexion_app.app, origins=origins_re)
cors = CORS(connexion_app.app, origins=origins_re)
@app.cli.command()

4
run.py
View File

@ -1,3 +1,5 @@
from crc import app
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000)
flask_port = app.config['FLASK_PORT']
app.run(host='0.0.0.0', port=flask_port)