oblio
oblio

Reputation: 1633

Connection aborted while running the Node.js "hello world" on Windows 7

Answered/fixed:

Oops! 10000 points to jimw!

I'm trying to start a hobby project using Node. So I got going:

Code:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
  1. Firebug output: Aborted - 127.0.0.1
  2. Windows Firewall disabled - same result.
  3. Checked netstat: netstat -na | findstr 1337: TCP 127.0.0.1:1337 0.0.0.0:0 LISTENING
  4. Checked that Node is running - it was.
  5. Changed the port - same result.
  6. Tried to find Node server logs - can't seem to find any.

Any ideas? Right now I'm kind of baffled that "Hello world" isn't working (!)

Upvotes: 0

Views: 704

Answers (1)

oblio
oblio

Reputation: 1633

I don't know how to close the question, so I'll just answer myself. jimw's comment was the answer - I was trying to access the wrong port because I entered localhost/1337 instead of localhost:1337, I was just blind.
Thanks a lot ;)

Upvotes: 1

Related Questions