async function sendAndGetData(data) {
let response = await fetch('/', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: data
})
});
response = await response.json;
console.log(`${response.id} / ${response.data}`);
}
let counter = 0;
app.post('/', (req,res) => {
counter += 1;
res.send({
id: counter,
data: `Client data: ${req.body.data} / Query id: ${counter}`
})
})