- Make sure you have a CouchDB running on localhost:5984, otherwise edit
- Create a new CouchDB database called 'node-comment'
Run the push/poll server in a terminal each
# Terminal A $ node bin/poll_server.js # Terminal B $ node bin/push_server.js
Navigate to http://localhost:8011/
You should now be able to send messages through the
push.html page and see them appear on
bin/push_server.js provides a HTTP server that receives message via JSONP and stores them as CouchDB documents.
bin/poll_server.js listens to CouchDB's /_changes stream to find out about new messages coming in. It then delivers the new messages to any clients that are listening.
The poc can be configured by modifying the
config/default.js file. However, the poll.html page has the poll port hardcoded for now.
- node-couch: CouchDB connector. Had to fix it to work with latest node version. I'd prefer to write a better one, but it does the job for now.
- node-paperboy: A node module I wrote to serve static HTML/JS/etc. files
- jquery: Hopefully your JS library of choice : )
- jquery-jsonp: jQuery has only minimal JSONP support. This plugin has all the goods!