Bump PORT recovery with other environment vars

This commit is contained in:
Gabriel Augendre 2016-09-17 13:40:30 +02:00
parent fd63fbe9b9
commit 1b205e4b1d
No known key found for this signature in database
GPG key ID: D2B6A5B41FC438B1

9
app.py
View file

@ -5,6 +5,10 @@ from icalendar.cal import Calendar, Component
app = Flask(__name__) app = Flask(__name__)
PORT = int(os.environ.get('PORT', 5000))
BASE_URL = os.environ.get('BASE_URL', None)
EXCLUDED_COURSES = os.environ.get('COURSES', '').split(',') EXCLUDED_COURSES = os.environ.get('COURSES', '').split(',')
EXCLUDED_TYPES = os.environ.get('TYPES', '').split(',') EXCLUDED_TYPES = os.environ.get('TYPES', '').split(',')
@ -13,8 +17,6 @@ GROUP = os.environ.get('GROUP', '1')
ALLOWED_YEARS = os.environ.get('ALLOWED_YEARS', '3,4,5').split(',') ALLOWED_YEARS = os.environ.get('ALLOWED_YEARS', '3,4,5').split(',')
ALLOWED_GROUPS = os.environ.get('ALLOWED_GROUPS', '1,2,3').split(',') ALLOWED_GROUPS = os.environ.get('ALLOWED_GROUPS', '1,2,3').split(',')
BASE_URL = os.environ.get('BASE_URL', None)
@app.route("/") @app.route("/")
def hello(): def hello():
@ -92,5 +94,4 @@ def should_add(event):
and course_type not in excluded_types and course_type not in excluded_types
if __name__ == "__main__": if __name__ == "__main__":
port = int(os.environ.get('PORT', 5000)) app.run('0.0.0.0', PORT)
app.run('0.0.0.0', port)