-
-
Save rupesh2017/1551c56e39759b412624f0202073b931 to your computer and use it in GitHub Desktop.
chat (1 to 1) line 28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
from flask import Flask,jsonify,render_template,request | |
from flask_socketio import SocketIO,emit,join_room,leave_room | |
from werkzeug import secure_filename | |
app = Flask(__name__) | |
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY") | |
socketio=SocketIO(app) | |
@app.route("/") | |
def index(): | |
return render_template("index.html") | |
@socketio.on("submit text") | |
def text(data): | |
selection = data["selection"] | |
user = data["user"] | |
socket.id = data["socketid"] | |
emit("announce text",{"selection":selection,"user":user},session.id) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment