So I download Windows binaries from node’s site and installed on my Windows 7 machine which is installed fine, when I do:
node --version
It correctly displays its version: v0.6.7
Here is the hello world program:
// app.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8000, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8000/');
And when I do:
node app.js
I get the response fine:
Server running at http://127.0.0.1:8000/
However, when I browser the URL http://127.0.0.1:8000, the page keeps on running (on status bar it says waiting for 127.0.0.1...).
Can anybody help me how to make it to output Hello World ?
This is what I get with curl:
nothing wrong with it. Try updating node to the latest stable version (but I don’t see how it can help) and be sure any process except node is owning the tcp port 8000.