<h1>Live resultater</h1>
<br>
<table>
<tr>
<th>Some shit</th>
</tr>
</table>
<script>
var source = new EventSource('stream.php');
source.addEventListener('message', function(e)
{
rows = JSON.parse(e.data);
console.log(rows);
// update table
root = document.getElementById("root");
rows.forEach(row => root.insertAdjacentHTML(
'beforebegin',
`<tr><td>${row.teamId}</td><td>${row.id}</td></tr>`
));
}, false);
</script>