Add some logging around the users and chat.

This commit is contained in:
Dave Smith-Hayes 2024-10-27 22:52:07 -04:00
parent f6947f32f1
commit 8b55e01bfa

View File

@ -14,8 +14,7 @@ const { upgradeWebSocket, websocket } = createBunWebSocket<ServerWebSocket>();
app.get("/chat-service", upgradeWebSocket((c) => {
return {
onOpen(event, ws) {
console.log(ws);
console.log(`Connection established ${event}`);
console.log(`Connection established from ${ws.raw.remoteAddress}`);
chatRoom.addListener('message-added', async function (e) {
const message = JSON.stringify({