From 1f877fddbe48ffbd65511ae66f0b7008b09d0126 Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Mon, 7 Oct 2019 10:09:49 -0700 Subject: [PATCH] init socketio --- app.py | 12 +++++++----- requirements.txt | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 4a7d7c9..4e9ec07 100644 --- a/app.py +++ b/app.py @@ -7,15 +7,17 @@ from configuration.config import DevelopmentConfig from flask_bcrypt import Bcrypt from flask_cors import CORS +from flask_socketio import SocketIO + +app = Flask(__name__) +bcrypt = Bcrypt(app) +app.config['CORS_HEADERS'] = 'Content-Type' +app.config.from_object(DevelopmentConfig) +socketio = SocketIO(app) def create_app(): - app = Flask(__name__) CORS(app, resources={r"/api/*": {"origins": "http://localhost:3000"}, r"/auth/*": {"origins": "http://localhost:3000"}}) - app.config['CORS_HEADERS'] = 'Content-Type' - app.config.from_object(DevelopmentConfig) db.init_app(app) ma.init_app(app) return app - -bcrypt = Bcrypt(create_app()) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index fab2ace..e4a0a43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ Flask-Cors==3.0.8 flask-marshmallow==0.10.1 Flask-Migrate==2.5.2 Flask-Script==2.0.6 +Flask-SocketIO==4.2.1 Flask-SQLAlchemy==2.4.1 Flask-Testing==0.7.1 isort==4.3.21 @@ -27,6 +28,8 @@ PyJWT==1.7.1 pylint==2.4.2 python-dateutil==2.8.0 python-editor==1.0.4 +python-engineio==3.9.3 +python-socketio==4.3.1 six==1.12.0 SQLAlchemy==1.3.8 typed-ast==1.4.0