Skip to content

Instantly share code, notes, and snippets.

@rupesh2017 rupesh2017/a Secret
Created Aug 28, 2018

Embed
What would you like to do?
chat (1 to 1) line 28
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
You can’t perform that action at this time.