-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun.py
27 lines (26 loc) · 1.11 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Entry point for running a GifSync server without gunicorn.
When running from Docker, the web.env file is used to manage the Port
instead, and this file is not ran.
Making changes when running via Docker does not require "development" or
"debug" mode on changes.
However, changes made will require a few seconds (10s or so)
to be picked up.
"""
from gifsync import app, config
if __name__ == "__main__":
# YOU SHOULDN'T HAVE TO MODIFY THE PORT OR DEBUG! The Production server
# provided by flask is pointless.
# Change the default port/environment by modifying the second parameter in
# "on.environ.get", OR by setting
# environment variables for PORT and/or FLASK_DEBUG.
# "true" debug should be used when developing to prevent the need of
# restarting the
# local server after changes made to HTML. Does NOT update CSS changes
# automatically, requiring a Hard Reload of
# your web browser.
port = config.port
if app.config["DEBUG"] is True:
app.run(host="0.0.0.0", port=port, debug=True)
else:
app.run(host="0.0.0.0", port=port)