aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2018-11-02 21:33:04 +0100
committerThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2018-11-02 21:33:04 +0100
commitaa862af791b28c173a0699b26e5943b2f46e3716 (patch)
treee635eeae20136e811662dbbc86f4a419ed4e1a0e
parentd8e817884de03a9230092138fa7e331472b1dc0f (diff)
Used PORT environment variable.
-rw-r--r--Procfile2
-rwxr-xr-xapp/__main__.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/Procfile b/Procfile
index 924f5c0..689e36a 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-web: pipenv run python -m app $PORT
+web: pipenv run python -m app
diff --git a/app/__main__.py b/app/__main__.py
index 79e8258..f57c9de 100755
--- a/app/__main__.py
+++ b/app/__main__.py
@@ -2,6 +2,7 @@
import sys as _sys
import os.path as _path
+from os import environ as _environ
from flask import Flask as _Flask, render_template as _template, \
request as _r
@@ -48,6 +49,6 @@ def run_app(port, debug = False):
return app.run(port = port, debug = debug)
if __name__ == '__main__':
- run_app(_sys.argv[1], True)
+ run_app(int(_environ.get('PORT')), True)
# End of file.