Где на серваке ты ttf отображаешь?:)
const server= http.createServer ((req,res)=>{
//// hi(yellow
,contentType);
let filePath = path.join(__dirname, 'public', '../../src',req.url === '/' ? 'imagination.html' : req.url)
let ex=path.extname(filePath);
if(!ex)filePath+=".html";
switch(ex) {
case "ttf":
contentType = "application/x-font-ttf"
break
default:
contentType = "text/html"
}
res.writeHead(200, {"Content-Type": contentType})
fs.readFile(filePath, "utf-8", (err,data)=>{
ErrorHandler(err);
if(1)res.end(data+<h2>${filePath}</h2>
);else if(ex=="ttf"){
// !!! Не знаю, что тут прописать, чтобы все работало. ПРосьба помогите
//res.end(fs.readFileSync(filePath),"binary");
}
}) // fs.readFile-end
})// createServer-end