I try to put an html in a page in node.js and this is the code:
var http = require('http');
var fs=require('fs');
fs.readFile('C:\Users\Eventi\Desktop\Node.js\Progetti\ProveNodeJS\NodeJSProve\home.html', function (err, html) {
if (err) {
}
http.createServer(function(request, response) {
response.writeHeader(200, {"Content-Type": "text/html"});
response.write(html);
response.end();
}).listen(8000);
});
When I go at the url http://localhost:8000 I obtain the error first argument must be a string or Buffer node js . Anyone can help me?