(я использую MacBook Air). < /p> CODE html ниже :: < /p>
CODTP = :: < /p>
code. require ('http');
const fs = require ('fs'); < /p>
const hostname = '127.0.0.1'; < /p>
const port = 3000; < /p>
const home = fs.readfilesync ('index.html'); fs.readfilesync ('./ a eable.html');
const contact = fs.readfilesync ('./ contact.html');
const services = fs.readfilesync ('./ services.html'); http.createserver ((req, res) => {
console.log(Req.url);;res.statusCode = 200;
res.setHeader('Content-Type', 'text/html');
res.end(home);
< /code>
}); < /p>
server.listen(port, hostname, () => {
console.log (Server running at http://${hostname}:${port}/< /code>);
}); < /p>
Ошибка приведена ниже ::: < /p>
internal/fs/utils.js:307
throw err;
^< /p>
error: enoEnt: no file или hilectory, open 'index.ht' ht ' p> p> enoEnt: no file или hilectory, open' index.ht 'ht' ht 'ht' ht 'ht' ht 'ht' ht 'ht' ht 'ht' /p> enoEnt: no File или Directory.at Object.openSync (fs.js:476:3)
at Object.readFileSync (fs.js:377:35)
at Object. (/Users/shouryasharma/Desktop/Web Dev/tut67/index.js:7:17)
at Module._compile (internal/modules/cjs/loader.js
at Object.Module._extensions..js (internal/modules/cjs/loader.js
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
< /code>
errno: -2,
syscall: 'open',
code: 'enoent',
path: 'index.html'
} < /p>
Подробнее здесь: https://stackoverflow.com/questions/669 ... ng-node-js