Tell us what’s happening:
Describe your issue in detail here.
Completed with two possible ways to see if it could be the way to solve the one that was not accepted.
app.post(“/name”, (req, res)=>{
let first = req.body.first
let last = req.body.last
let string = first + " " + last;
res.json({ name: string })
})
app.post(“/name”, (req, res)=>{
let string = req.body.first + " " + req.body.last;
res.json({ name: string })
})
However, although the name was displayed on the screen, it disappeared after a very short while in the replit webview console. In a new tab, the {“name”:“Johns Does”} remains.
All the best
solution: boilerplate-express (3) - Replit
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Challenge: Basic Node and Express - Get Data from POST Requests
Link to the challenge: