1
htmlファイル内のすべてのリンクを置換したいが、これは機能しません。htmlでのURLの置換が機能しない
var fs = require('fs');
fs.readFile(__dirname + '/index.html', 'utf8', function(err, html){
if(!err){
html = html.replace('https://mysite1.github.io/',
'https://example.com/');
console.log(html);
}
else{console.log(err);}
});
uがこれで私を助けることができますか?私はnodejs/JavaScriptで少し新しいです
'replace'文の前に' html'の値は何ですか? – gurvinder372
https://pastebin.com/V1VukHVBペーストビンに追加しました – user3569641