Allows port to be set via environment variable

This commit is contained in:
Aaron Louie 2020-05-15 21:32:33 -04:00
parent 715a43f517
commit bf563e177b
3 changed files with 7 additions and 4 deletions

6
Pipfile.lock generated
View File

@ -912,10 +912,10 @@
}, },
"more-itertools": { "more-itertools": {
"hashes": [ "hashes": [
"sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c", "sha256:558bb897a2232f5e4f8e2399089e35aecb746e1f9191b6584a151647e89267be",
"sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507" "sha256:7818f596b1e87be009031c7653d01acc46ed422e6656b394b0f765ce66ed4982"
], ],
"version": "==8.2.0" "version": "==8.3.0"
}, },
"packaging": { "packaging": {
"hashes": [ "hashes": [

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. JSON_SORT_KEYS = False # CRITICAL. Do not sort the data when returning values to the front end.
NAME = "CR Connect Workflow" NAME = "CR Connect Workflow"
FLASK_PORT = environ.get('FLASK_PORT', default="5000")
CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default="localhost:4200, localhost:5002")) CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default="localhost:4200, localhost:5002"))
DEVELOPMENT = environ.get('DEVELOPMENT', default="true") == "true" DEVELOPMENT = environ.get('DEVELOPMENT', default="true") == "true"
TESTING = environ.get('TESTING', default="false") == "true" TESTING = environ.get('TESTING', default="false") == "true"

4
run.py
View File

@ -1,3 +1,5 @@
from crc import app from crc import app
if __name__ == "__main__": 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)