#!/bin/bash
# This runs a development server with gunicorn.
#  You need a .env file that sets the python (virtualenv, conda, etc) and shell environments.
#  See contributing.md

source .env

# export GUNICORN_CMD_ARGS="--reload --worker-class flask_sockets.worker --log-level=debug --certfile=cert.pem --keyfile=key.pem --bind '127.0.0.1:5000'"
GUNICORN_CMD_ARGS="--reload --worker-class flask_sockets.worker --log-level=debug --bind '0.0.0.0:5000'"

FILE=/usr/bin/heroku

if [ -f "$FILE" ]; then
    echo "$FILE is present"
    heroku local
else 
    echo "$FILE does not exist"
    gunicorn wsgi:app
fi