2021-05-31 13:42:58 +00:00
|
|
|
"""
|
|
|
|
Give a unique entry point for gunicorn
|
|
|
|
"""
|
|
|
|
|
|
|
|
from gncitizen.utils.env import load_config
|
|
|
|
from server import get_app
|
|
|
|
|
|
|
|
# get the app config file
|
|
|
|
config = load_config()
|
|
|
|
|
|
|
|
# give the app context from server.py in a app object
|
|
|
|
app = get_app(config)
|
|
|
|
port = app.config["API_PORT"] if app.config.get("API_PORT", False) else 5002
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2022-05-30 12:37:35 +00:00
|
|
|
app.debug = app.config.get("DEBUG", False)
|
2021-05-31 13:42:58 +00:00
|
|
|
app.run(host="0.0.0.0", port=port)
|