Riskless/app.py

21 lines
366 B
Python
Raw Normal View History

2022-12-26 14:13:02 +00:00
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
2022-12-29 14:11:18 +00:00
2022-12-26 14:13:02 +00:00
app = Flask(__name__)
socketio = SocketIO(app)
2022-12-29 14:11:18 +00:00
2022-12-26 14:13:02 +00:00
@app.route('/')
def index():
return render_template('index.html')
2022-12-29 14:11:18 +00:00
@socketio.event
def message(data):
print(data)
emit('message', data, broadcast=True)
2022-12-26 14:13:02 +00:00
if __name__ == '__main__':
2022-12-29 14:11:18 +00:00
socketio.run(app, log_output=True)