🐗🐄 Checkpoint

./public/style.css:530995/411
./views/room.handlebars:530995/42
./server.js:530995/182
./views/index.handlebars:530995/1364
This commit is contained in:
Glitch (hello-express)
2020-04-09 11:40:21 +00:00
parent 385214f520
commit 93b4bbe4ed
4 changed files with 59 additions and 8 deletions

View File

@@ -37,15 +37,17 @@
};
socket.onmessage = function(event) {
console.log(event.message);
console.log(event);
};
socket.onerror = function(error) {
alert(`[error] ${error.message}`);
};
document.getElementById('buzzer').addEventListener('mousedown', function() {
socket.send(JSON.stringify({ type: "buzz" }));
document.getElementById('buzzer').addEventListener('click', function() {
socket.send(JSON.stringify({
type: "buzz"
}));
});
</script>
</body>