das ist mein js Datei Code:Wie rendern HTML-Seite in node.js mit HTTP-Antwortobjekt?
fs.readFile(__dirname+'/product_list.html',function(error,productForm){
if(error){
response.write("error in getting file"+error);
}else{
connection.query("select * from products",function(err,result){
if(err){
console.log("In funciton errr");
}else{
response.writeHead(200, "OK", {'Content-Type': 'text/html'});
response.write(productForm,{result:result});
}
});
response.end();
}
});
i auf product_list.html Seite führen wollen .....
können Sie eine Template-Engine als 'ejs' oder andere verwenden es schneller auf diese Weise sein und sauberen –
i render auf product_list.html Seite aber ... nicht Ergebnis Objekt auf t bekommen Hut Seite – Hemant