For most of what this blog is about is based on node.js. So we need a way to install and use node.js in windows.
Let's proceed to http://nodejs.org/#download
That's the windows msi installer, the one we want. By the time you read this they might be on v1.0.0 for all I know, but I'm guessing it'll be about the same. Currently the 0.6.5 is ~3 MB. Let's run it.
Let's open up a text file in notepad and copy/paste this test node.js application:
require('http').createServer(function(req,res){
res.writeHead(200,'text/plain');
res.end('Hello World!');
}).listen('8080');
So now we run in a command prompt/powershell:
You can bring that up with Windows Key + R and typing in CMD
Your node.exe is located usually <root>\Program Files\nodejs\node.exe
so probably: C:\Progra~1\nodejs\node.exe
node.exe c:\server.js
The server.js is the one I had you create and save to your root directory earlier.
If it's your first time doing this you'll end up with:
Click "Allow access"
Now open up your browser (here I am using Chrome 17)
And let's see if our server.js is running by following the link or typing it in:
http://localhost:8080/
If your results look something like this you've done it!
Node.js is fully installed, running, and tested. Awesome.
No comments:
Post a Comment