I DID STUFF, GOD A PROC MACRO AND SHIT
This commit is contained in:
commit
22319e84a1
28 changed files with 3101 additions and 0 deletions
2
assets/web/index.html
Normal file
2
assets/web/index.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<button onclick="onClick()", id="login_button">Click me!, also open terminal</button>
|
||||
<script src='socket.js'></script>
|
15
assets/web/socket.js
Normal file
15
assets/web/socket.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const socket = new WebSocket('ws://localhost:3001/ws');
|
||||
|
||||
socket.addEventListener('open', e => { socket.send('hello server'); });
|
||||
|
||||
socket.addEventListener('message', e => {
|
||||
console.log('message from server', e.data);
|
||||
if (e.data == 'ok') {
|
||||
document.getElementById('login_button').innerText = "logged in!";
|
||||
}
|
||||
});
|
||||
|
||||
function onClick() {
|
||||
socket.send('login admin admin123');
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue