Sunday, 16 April 2017

Node.js localhost error

im new in node.js and i couldn't make a simple server, i really dont know why, but at the time that i opened the localhost/'port', the page just... didnt charge. here is the code.

var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
server.listen(8080);
console.log("Server running at http://127.0.0.1:8000/");

in the console i have this message console message

but in the browser i have this browser

i really... really would like to know why is that... thanks :)



via Luis Hernandez

No comments:

Post a Comment