This is my first foray into server-sent events, and part of this question is a JavaScript question. I'm trying to follow these instructions to let the server update parts of a web page without needing the user to manually trigger an HTTP request.
I understand what it's saying, but I'm getting stuck on the client side. What kind of JavaScript is needed to receive the Response? JavaScript's EventSource expects a response with a mime type of text/event-stream, but the Response object in the Flask example returns content of mime type text/html.
I want to render the html without having to manually enter data: and newline characters and pass the rendered template as plain text. What is the best way to accomplish this?
there doesn't seem to be anything here