ServerSide (app.js):
Я получаю некоторые данные из БД и помещаю их в массив
app.post('/sendform', (req,res) =>{
var array = [{"h":"1"},{"e","2"}];
res.send(array);
)}
ClientSide (клиент.js):
Я хочу получить этот массив и добавить его в свой index.html
function tableContent(){
fetch('/')
.then(res => {
console.log(res);
if(res.ok) return res.json();
});
.then(data => {
//do something with html file
});
}