This seemed to be easy one but after of couple solutions I gave up not knowing Node.js very well.
So the question is how to return a value from that function (this code below won't work):
let content;
app.post('/problems', function(req, resp){
resp.append('Access-Control-Allow-Origin', '*')
resp.append('Access-Control-Allow-Headers', 'Content-Type')
console.log(req.body)
resp.json(req.body)
content = req.body;
return content
})
console.log('content' + content)
As I understand it is a promise but syntax won't work either:
.then(() => console.log(content))
Thank you for helping.