This is an example application demonstrating one way to approach delivering Server-Sent Events with Node.js (leveraging Express.js).
The application accompanies a blog post at: http://tomkersten.com/articles/server-sent-events-with-node/
- Redis
- Node.js
- Express.js
- Clone the repo locally
- cd into the cloned directory and run
node app.js
- Visit http://localhost:8000/ in one browser window (Page A)
- Open another window and visit http://localhost:8000/fire-event/anything-you-want-here (Page B)
- Look at 'Page A' again...and you should see a message including the name of the page you
visited ('anything-you-want-here')
- Additionally, if you open up
redis-cli
and issuePUBLISH updates 'some message here'
, you should see your message show up as well.
- Additionally, if you open up