pug different view if logged in or out
This commit is contained in:
11
src/public/chat.js
Normal file
11
src/public/chat.js
Normal 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 = '';
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user