Node seems to be everywhere at the moment. Long on my list of things to take a look at, I finally took the time to sit down with it yesterday and get it up and running and get a feel for what it does.
As always, my code is on GitHub, and the site is live on Heroku. This sample is literally a Hello World, with so many moving parts, I really wanted to just focus on the raw details of getting Node running first in a Linux VM, then on Windows, then on Heroku.
Both Node and Heroku provide great instructions to get everything up and running, so they should be your first port of call.
With how easy Node is to get running on Windows now, there really is no excuse not to give it a go.
Simply download the stand-alone node.exe from here.
Put it in a folder, and create a HelloWorld.js file with the following content.
Then run node HelloWorld.js and hit http://localhost:8080/ in your browser.
At it’s heart, Node is about IO and sockets. It is not specifically about the web, people have just seen how useful it can be for web development.
Before you get too far into it, you are likely to want to start plugging in some other packages, such as a routing framework to manage your requests and a view engine to render your HTML>
This is where the Node Package Manager (npm) comes in. The node install instructions linked above explain how to install this on windows, which has been seamless for me so far.
Another recent blog post I will call out to take a look at is Jon Galloway’s effort today which includes a lot of detail and goes into hosting the node.exe process inside IIS on windows servers.