0

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);
});

The error i get enter image description here

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?

Nonemoticoner
  • 650
  • 5
  • 14
aiden87
  • 929
  • 8
  • 25
  • 52

0 Answers0