我不能在途中发射。我想在函数被调用时发出,但它给出了错误。
像这样`
@app.route('/')
def index():
return render_template('index.html')
@socketio.on('my event')
@app.route('/hello', methods=['POST', 'GET'])
def hello():
emit('my response', {'data': 'got it!'})
return "11"发布于 2020-08-06 15:30:54
在flask-socketio中使用namespace在路由中发出。
@socketio.on('my event', namespace='/hello')
def hello():
emit('my response', {'data': 'got it!'})
return "11"https://stackoverflow.com/questions/63264348
复制相似问题