Im new to nodeJs and I want to read file from the system, I was able to see the file content in the console but not in the browser and I
what am I missing here?
var myData = null;
fs.readFile('C:\\Users\\jbt\\Desktop\\simplefile.txt', 'utf8', function (err,data) {
if (err) {
return console.log("the error is: " + err);
}
console.log(data);
myData = data;
});
res.send(myData);
I try some other post in SO but nothing helps..