All of the examples are pretty much the same script: Hello World or
something.
Where do you drop this script and how to you run it.
I installed on Node.js on Windows 7.
I have a folder where I store the code for books I am walking through.
Like:
C:\Books\APress\The Definitive Guide to HTML5\chpt6
C:\Books\APress\The Definitive Guide to HTML5\chpt7
So I made a new folder for the Node.js site example since I need to get
this running for the HTML5 Forms part of a book I am reading:
"Definitive Guide to HTML5" by Adam Freeman.
C:\Books\APress\The Definitive Guide to HTML5\NodeJS
I drop the script:
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/');
I change the port to 8080 since everyone seems to be saying to use that.
}).listen(8080, '127.0.0.1');
So now I have:
C:\Books\APress\The Definitive Guide to HTML5\NodeJS\example.js
I run Start -> Node.js to start the nodejs console.
I get a ">" prompt.
I write console.log('hello')
That works.
At the command prompt I type:
C:\Books\APress\The Definitive Guide to HTML5\NodeJS\example.js
It just says:
...
and does nothing.
I hope at this point 8080 is listening.
So I go to a browser and type http://localhost:8080.
At first this said site could not be found.
My :80 is taken up by a SharePoint site and I want to use 8080 anyway.
So I setup a site in IIS called NodeJsServer.
And set up binding for all unassigned, localhost: port 8080.
When I go there [ http://localhost:8080 ]
I get:
HTTP Error 403.14 - ForbiddenThe Web server is configured to not list the
contents of this directory.
I just can't figure out the ins and outs of what I need to do to get this
all running.
Why is this so confusing?
Where exactly am I supposed to drop example.js or server.js or what ever?
Am I on the right track?
Please somebody help.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en