Tuesday, May 21, 2024
 Popular · Latest · Hot · Upcoming
181
rated 0 times [  185] [ 4]  / answers: 1 / hits: 115869  / 12 Years ago, fri, january 4, 2013, 12:00:00

I have installed node.js from here http://nodejs.org/ . in my windows8 machine. copied the example server code in my server.js file



var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');


then opened the node.js prompt and written node c:/node/server.js
but nothing happens.
I am a php developer just trying hands on it, any guidelines will really be helpful.


More From » node.js

 Answers
3

You don't need to go in node.js prompt, you just need to use standard command promt and write



node c:/node/server.js


this also works:



node c:nodeserver.js


and then in your browser:



http://localhost:1337

[#81085] Thursday, January 3, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dequant

Total Points: 88
Total Questions: 99
Total Answers: 95

Location: Ukraine
Member since Sun, Dec 13, 2020
4 Years ago
dequant questions
;