Hi guys.
I cant seem to complete the last exercise of the back end development course. I have really given it a go but its keeps rejection the solutions. I have no idea what am missing… Any help will be much appreciated.
my solution
app.post(‘/name’, (req, res) => {
var firstName = req.body.first;
var lastName = req.body.last;
res.json({ name: ${firstName} ${lastName}
});
console.log(${firstName} ${lastName}
);
});
app.get(‘/’, (req, res) => {res.sendFile (__dirname + ‘/views/index.html’);});
Your project link(s)
https://boilerplate-express-2.conradp.repl.co
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Challenge: Get Data from POST Requests
Link to the challenge: