Added websocket registration to our configuration process, now all event handler files added to /events folder will be registered at app run time.
Added connect event handler (disconnect can go in here too).
FRONTEND
Added socket connection to our vitetest testcases, it will run a test check when you run npm run test.
To test socket connection live, I added a TestSocketConnection.tsx file to our App.tsx. Make sure backend server is running (py app.py) and then run client-side npm run dev if you check the logs from the server you'll see the user connected message. You can also check console in browser for the Successfully connected to server! message.
BACKEND
connect
event handler (disconnect can go in here too).FRONTEND
vitetest
testcases, it will run a test check when you runnpm run test
.TestSocketConnection.tsx
file to ourApp.tsx
. Make sure backend server is running (py app.py
) and then run client-sidenpm run dev
if you check the logs from the server you'll see the user connected message. You can also check console in browser for theSuccessfully connected to server!
message.