<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Reactive Programming with Spring 5</title>
</head>
<body>
<div>
    <ul id="events"></ul>
</div>
<script type="application/javascript">
    function addMessage(message) {
        const el = document.createElement("li");
        el.innerHTML = message;
        document.getElementById("events").appendChild(el);
    }

    if (!!window.EventSource) {
        const eventSource = new EventSource("/temperature-stream");

        window.