Node.js and Socket.IO
Of course this is a demo which means that there is still (a lot of) room for improvements. I’ve used to save the statistic values because it was a mandatory part of the assessment.
So how does the Node.js application work? To start the application index.js has to be run trough node.js command prompt.
When a resource is requested the following process starts. Pathname is everything that comes after localhost:1337/ ( localhost:1337/[pathname]).
When a websocket connection is established.
When the webserver receives new form data.
The HTML pages
Conclusion & Resources
I hope this post gives a nice overview of the vote/poll application. Node.js and Socket.IO are pretty cool technologies that I will surely use in future projects!
The Node Beginners Book was a very useful resource for getting started with Node.js.