first commit
This commit is contained in:
20
main.py
Normal file
20
main.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from flask import Flask, render_template
|
||||
from flask_socketio import SocketIO, send
|
||||
import sqlite3
|
||||
|
||||
app = Flask(__name__)
|
||||
socketio = SocketIO(app)
|
||||
|
||||
|
||||
@socketio.on('message')
|
||||
def onMessage(msg):
|
||||
send(msg, broadcast=True)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def routeLogin():
|
||||
return render_template("chat.html")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
socketio.run(app, host='0.0.0.0', debug=True, allow_unsafe_werkzeug=True)
|
||||
Reference in New Issue
Block a user