I am learning node.js and this next instruction is presented to me; nevertheless when executing it through node filename.js I get " Unable to access this WEB site" , I appreciate any guidance.
var http=require("http");
var fs=require("fs");
http.createServer(function (req,res) {
fs.readFile("./index.html",function(err,html){
res.writeHead(200,{"Content-Type":"text/html"});
res.write(JSON.stringify({nombre:"Uriel",username:"uriel"}));
res.end();
}).listen(8000);
});