Answer the question
In order to leave comments, you need to log in
[fs - express.js] What's the problem?
There are always problems reading FS files.
Here is the code:
fs.readFile('/../../../../../root/projects/kulonful.ru/hiden/index.html', function(data) {
console.log(data);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.setHeader('Dev-Help', 'https://vk.com/kulonful');
res.end(data);
}
Answer the question
In order to leave comments, you need to log in
Well, that's right, null means that there was no error while reading. Is it bad? If we assign one more argument to the callback function, then it will contain the successfully read file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question