I'm trying to read and display a basic html file with node.js, but i get no luck, since anything i do it returns the same error.
Here's the code
var http = require('http');
var fs = require('fs');
var url = require('url');
var port = 3000;
fs.readFile('./funckcionalnosti.html', function (err, html) {
if (err) {
throw err;
}
http.createServer(function (request, response) {
response.writeHeader(200, { "Content-Type": "text/html" });
response.write(html);
response.end();
}).listen(3000);
});
I've read some things about node not dealing with temporary files, or that my file may not be within current script...i already tried moving files, tried _dirname and copying the entire path name, but it still won't work.
Any help please?