Demo of Server-Sent Events (SSE) using the EventSource
Javascript API with client side Javascript and a simple node http
server for the backend.
Reference the Mozilla documentation around the EventSource API for more information on what's happening under the hood here.
docker build -t server-sent-events .
docker run --rm -p 8000:8000 -v $(pwd):/service server-sent-events
- In your browser visit http://localhost:8000
- Wait for the events to come in and get displayed in the DOM.