0
atım hatası attığında "throw er;" "css" bölümünde, ancak mevcut değil. Birisi bu hatayı görebilir mi?nodejs komutunu çalıştırmayı denediğimde (CSS'de)
var http = require('http'),
fs = require('fs');
http.createServer(function(req, res) {
fs.readFile('./index.html', function (err, data) {
if (err) { throw err; }
res.writeHeader(200, {'Content-Type': 'text/html'});
res.write(data);
res.end();
});
fs.readFile('./main.js', function (err, data) {
if (err) { throw err; }
res.writeHead(200, {'Content-Type': 'text/javascript'});
res.end(data);
res.end();
});
fs.readFile('./style.css', function (err, data) {
if (err) { throw err; }
res.writeHead(200, {'Content-Type': 'text/css'});
res.write(data);
res.end();
});
}).listen(8000);
Konsolda aldığınız hatayı tam olarak yapıştırmanız varsayalım! – vkstack