confirm socketio run app
This commit is contained in:
parent
1f877fddbe
commit
44d365199f
3 changed files with 8 additions and 4 deletions
6
app.py
6
app.py
|
@ -16,8 +16,10 @@ 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"}})
|
||||
CORS(app, resources={
|
||||
r"/api/*": {"origins": "http://localhost:3000"},
|
||||
r"/auth/*": {"origins": "http://localhost:3000"}
|
||||
})
|
||||
db.init_app(app)
|
||||
ma.init_app(app)
|
||||
return app
|
||||
|
|
|
@ -12,6 +12,8 @@ Flask-Script==2.0.6
|
|||
Flask-SocketIO==4.2.1
|
||||
Flask-SQLAlchemy==2.4.1
|
||||
Flask-Testing==0.7.1
|
||||
gevent==1.4.0
|
||||
greenlet==0.4.15
|
||||
isort==4.3.21
|
||||
itsdangerous==1.1.0
|
||||
Jinja2==2.10.1
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from app import create_app, db
|
||||
from app import create_app, db, socketio
|
||||
|
||||
# Blueprints
|
||||
from api.api import api
|
||||
|
@ -14,4 +14,4 @@ if __name__ == '__main__':
|
|||
app.register_blueprint(api)
|
||||
app.register_blueprint(auth)
|
||||
migrate = Migrate(app, db)
|
||||
app.run(port=8000, debug=True)
|
||||
socketio.run(app)
|
Loading…
Reference in a new issue