Currently I'm trying to learn what is node.js. I have installed node.exe in windows, don't know what is the next step to do some thing
Can you guys help me.
You create a js file, write your code and start the server with node.exe path/to/file.js
. After that you could open your Browser and have a look at the program.
Here a example (helloWorld.js
):
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200);
res.end('Hello World!');
}).listen(8080);
node.exe helloWorld.js
Open your Browser and look at localhost:8080
Also have a look at the documentation. Additionally you find on the developer page (at the bottom), an example how to set up a webserver.
You can use IIS Express to run nodejs on windows. Currently on Windows you can use webmatrix from http://web.ms/
Remember that you need to use X86 of node.exe even your system is x64, since IIS Express only ships as 32bit.
If you install webmatrix and try nodejs it's automatically configure everything for you.
Remember that if you not have installed nodejs then webmatrix will install old version for you.you need to manually install node.js from it's official website.
see justin's post http://jbeckwith.com/2012/06/07/node-js-meet-webmatrix-2/
http://www.microsoft.com/web/post/how-to-use-the-nodejs-starter-template-in-webmatrix
hope this help.
Since you are after learning and you are on a Win7 machine you can also host the node.exe in IIS. Perhaps you will find this guide helpful: http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx