Basic Node and Express - Get Query Parameter Input from the Client

Tell us what’s happening:
have to extract the query parameters and send a formatted json.
can’t figure out where is the mistake happening
my code :
app.post(“/name”, (req, res) => {

res.json({ name : ${req.query.first} ${req.query.last} });

})

Your project link(s)

solution: boilerplate-express - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.77

Challenge: Basic Node and Express - Get Query Parameter Input from the Client

Link to the challenge:

Build an API endpoint, mounted at GET /name .

Also, you might want to console.log what you are returning below and see if it meets the instructions’ requirements.

`${req.query.first} ${req.query.first}`

As said, it is supposed to be a GET request.

It might be the note at the bottom that is confusing you. It is just saying that in the next challenge you will use the same /name endpoint for a POST so you can use chaining with the methods if you make it an app.route().get().post() chain.

You can look at the docs for an app.route chaining example

thank you. problem resolved