From b711f63c4087b3a9f5617af5b55afe93f414ddf5 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 16 Feb 2021 12:00:36 +0100 Subject: working websocket connection --- api/game/new.py | 2 +- api/game/socket.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 api/game/socket.py (limited to 'api/game') diff --git a/api/game/new.py b/api/game/new.py index 6f777e3..fd65019 100644 --- a/api/game/new.py +++ b/api/game/new.py @@ -1,5 +1,5 @@ from flask import Blueprint, request, make_response -from main import cursor, connection +from db import cursor, connection from randid import new_uuid import time import json diff --git a/api/game/socket.py b/api/game/socket.py new file mode 100644 index 0000000..405d9cd --- /dev/null +++ b/api/game/socket.py @@ -0,0 +1,10 @@ +from flask import Blueprint, request, make_response +from flask_socketio import SocketIO, emit, disconnect +from main import socketio +import time +import json + +@socketio.on("connect", namespace="/game/socket") +def connect(): + print("connected") + -- cgit v1.2.3