Added Websockets to chat

This commit is contained in:
white
2025-01-25 12:45:09 +00:00
parent a409e74992
commit f4aed8b0cc
4 changed files with 85 additions and 83 deletions

View File

@@ -1,4 +1,4 @@
from flask import Flask, jsonify
from flask import Flask
# from flask_wtf.csrf import CSRFProtect, generate_csrf
from flask_session import Session
from blueprints.utils import logged_in_user
@@ -30,8 +30,9 @@ def create_app():
from blueprints.stripe import stripe_bp
from blueprints.user import user_bp
from blueprints.streams import stream_bp
from blueprints.chat import chat_bp
from blueprints.chat import chat_bp, socketio
# Registering Blueprints
app.register_blueprint(auth_bp)
app.register_blueprint(main_bp)
app.register_blueprint(stripe_bp)
@@ -39,4 +40,7 @@ def create_app():
app.register_blueprint(stream_bp)
app.register_blueprint(chat_bp)
# Tell sockets where the initialisation app is
socketio.init_app(app, cors_allowed_origins="*")
return app