init socketio

This commit is contained in:
Sorrel Bri 2019-10-07 10:09:49 -07:00
parent 95f2c70c8f
commit 1f877fddbe
2 changed files with 10 additions and 5 deletions

12
app.py
View file

@ -7,15 +7,17 @@ from configuration.config import DevelopmentConfig
from flask_bcrypt import Bcrypt from flask_bcrypt import Bcrypt
from flask_cors import CORS from flask_cors import CORS
from flask_socketio import SocketIO
def create_app():
app = Flask(__name__) app = Flask(__name__)
CORS(app, resources={r"/api/*": {"origins": "http://localhost:3000"}, bcrypt = Bcrypt(app)
r"/auth/*": {"origins": "http://localhost:3000"}})
app.config['CORS_HEADERS'] = 'Content-Type' app.config['CORS_HEADERS'] = 'Content-Type'
app.config.from_object(DevelopmentConfig) app.config.from_object(DevelopmentConfig)
socketio = SocketIO(app)
def create_app():
CORS(app, resources={r"/api/*": {"origins": "http://localhost:3000"},
r"/auth/*": {"origins": "http://localhost:3000"}})
db.init_app(app) db.init_app(app)
ma.init_app(app) ma.init_app(app)
return app return app
bcrypt = Bcrypt(create_app())

View file

@ -9,6 +9,7 @@ Flask-Cors==3.0.8
flask-marshmallow==0.10.1 flask-marshmallow==0.10.1
Flask-Migrate==2.5.2 Flask-Migrate==2.5.2
Flask-Script==2.0.6 Flask-Script==2.0.6
Flask-SocketIO==4.2.1
Flask-SQLAlchemy==2.4.1 Flask-SQLAlchemy==2.4.1
Flask-Testing==0.7.1 Flask-Testing==0.7.1
isort==4.3.21 isort==4.3.21
@ -27,6 +28,8 @@ PyJWT==1.7.1
pylint==2.4.2 pylint==2.4.2
python-dateutil==2.8.0 python-dateutil==2.8.0
python-editor==1.0.4 python-editor==1.0.4
python-engineio==3.9.3
python-socketio==4.3.1
six==1.12.0 six==1.12.0
SQLAlchemy==1.3.8 SQLAlchemy==1.3.8
typed-ast==1.4.0 typed-ast==1.4.0