summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorSacheendra Talluri <sacheendra.t@gmail.com>2017-01-25 16:17:36 +0100
committerSacheendra Talluri <sacheendra.t@gmail.com>2017-01-25 16:17:36 +0100
commit532ecf39611113ac59b084935f68016bd353e73f (patch)
treeecce75c171445755e20e2930682b1c78bbd9e15e /main.py
parentee0379056a25862102a5068bc579889ed963f4e7 (diff)
makes the app take config file as command line argument and opens port on all interfaces instead of localhost
Diffstat (limited to 'main.py')
-rw-r--r--main.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.py b/main.py
index bd2a3111..56f8e7c1 100644
--- a/main.py
+++ b/main.py
@@ -12,8 +12,12 @@ from oauth2client import client, crypt
from opendc.models.user import User
from opendc.util import exceptions, rest
+if len(sys.argv) < 2:
+ print "config file path not given as argument"
+ sys.exit(1)
+
# Get keys from config file
-with open('/var/www/opendc.ewi.tudelft.nl/web-server/config/keys.json') as file:
+with open(sys.argv[1]) as file:
KEYS = json.load(file)
STATIC_ROOT = os.path.join(KEYS['ROOT_DIR'], 'opendc-frontend', 'build')
@@ -144,5 +148,5 @@ def receive_message(message):
)
-SOCKET_IO_CORE.run(FLASK_CORE_APP, port=8081)
+SOCKET_IO_CORE.run(FLASK_CORE_APP, host='0.0.0.0', port=8081)