pug different view if logged in or out

This commit is contained in:
2025-02-12 18:44:30 +01:00
parent b547fc3b5e
commit 5cfb29131c
7 changed files with 69 additions and 60 deletions

11
src/public/chat.js Normal file
View File

@@ -0,0 +1,11 @@
const socket = io();
const form = document.getElementById('form');
const input = document.getElementById('input');
form.addEventListener('submit', function(e) {
e.preventDefault();
if (input.value) {
socket.emit('chat message', input.value);
input.value = '';
}
});