Add backend

This commit is contained in:
schmelczerandras 2020-10-04 19:05:32 +02:00
parent 4ad60813c9
commit 0f0a1eaf67
19 changed files with 355 additions and 45 deletions

29
backend/src/index.html Normal file
View file

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script
src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.1/socket.io.js"
integrity="sha512-AcZyhRP/tbAEsXCCGlziPun5iFvcSUpEz2jKkx0blkYKbxU81F+iq8FURwPn1sYFeksJ+sDDrI5XujsqSobWdQ=="
crossorigin="anonymous"
></script>
<title>Server info</title>
</head>
<body></body>
<script>
const socket = io({
transports: ['websocket'],
});
socket.on('reconnect_attempt', () => {
socket.io.opts.transports = ['polling', 'websocket'];
});
socket.emit('join', 'insights');
socket.on('insights', (message) => {
document.body.innerText += message;
});
</script>
</html>