Sending Server-Sent Events events into an AngularJS application in 20 lines of node.js server, 15 lines of client JS, and 5 lines of HTML.
This is heavily based on, but pared down to the essence of, the examples at:
- Writing an AngularJS App with Socket.IO
- Stream Updates with Server-Sent Events
- @cheeyeo's Server-Sent-Events-with-Node-JS
- AngularJS.org
Credit especially to @btford for the factory pattern that makes it all work.
Start the node.js server:
$ node server.js
Go to http://localhost:8080
in your browser.