diff --git a/Procfile b/Procfile index d11aab7..15ba5a7 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -web: gunicorn server:run +web: gunicorn --worker-class socketio.sgunicorn.GeventSocketIOWorker --log-file=- server:app release: python manage.py db upgrade \ No newline at end of file diff --git a/server.py b/server.py index 1c831cd..c0dcfcb 100644 --- a/server.py +++ b/server.py @@ -19,24 +19,14 @@ def api_home(): response = {"message": "hello world"} return jsonify(response) +app = create_app() +register_api_endpoints(app) +app.register_blueprint(server) +migrate = Migrate(app, db) +# added 10/14 +DATABASE_URL = os.environ['DATABASE_URL'] +conn = psycopg2.connect(DATABASE_URL, sslmode='require') + if __name__ == '__main__': - app = create_app() - register_api_endpoints(app) - app.register_blueprint(server) - migrate = Migrate(app, db) - # added 10/14 - DATABASE_URL = os.environ['DATABASE_URL'] - conn = psycopg2.connect(DATABASE_URL, sslmode='require') - socketio.run(app, debug=False) -def run: - app = create_app() - register_api_endpoints(app) - app.register_blueprint(server) - migrate = Migrate(app, db) - # added 10/14 - DATABASE_URL = os.environ['DATABASE_URL'] - conn = psycopg2.connect(DATABASE_URL, sslmode='require') - - socketio.run(app, debug=False)