From: Carl Worth Date: Wed, 7 Dec 2022 04:18:59 +0000 (-0800) Subject: Add a (half)-functional comment field X-Git-Url: https://git.cworth.org/git?p=zombocom-ai;a=commitdiff_plain;h=252a783ab361e62990e31e5cbf483663548a34be Add a (half)-functional comment field This sends the comment from the client to the server (but not back again). The server process simply prints the comment out on its console. --- diff --git a/index.html b/index.html index 5a74b47..b7b82de 100644 --- a/index.html +++ b/index.html @@ -64,6 +64,12 @@

+

+

+ +
+

+

@@ -100,6 +106,17 @@ mute.addEventListener("click", () => { diff --git a/index.js b/index.js index 336f36f..3ffea3d 100644 --- a/index.js +++ b/index.js @@ -12,9 +12,11 @@ app.get('/index.html', (req, res) => { io.on('connection', (socket) => { console.log('a user connected'); + socket.on('comment', (comment) => { + console.log('comment: ' + comment); + }); }); server.listen(port, () => { console.log(`listening on *:${port}`); }); -