Node/Express - Get Route Paramter Input (Echo Server)

Tell us what’s happening:
On the Node/Express challenge re: creating an echo server (using route paramter input), I had a working version, which would not pass tests even though it would properly echo, then went so far as to cut-and-paste the given solution, still not passing tests. Any suggestions or observations?

Your code so far

app.get("/:word/echo", (req, res) => {
  const { word } = req.params;
  res.json({
    echo: word
  });
});

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0.

Challenge: Get Route Parameter Input from the Client

Link to the challenge:

Hello there,

I cannot get your app to start up, because of a syntax error here:

app.route('/name').get((req, res) => {
  console.log(req.query);
  const { name } = req.query;
  console.log(name);
  res.json({
    name: name.first + ' ' + name.last;
    });
  });

Right, sorry about that, went on to try the next challenge. Here I forked it with the next challenge commented out … and it passes the test … so … uh … nevermind but thank you? :slight_smile:

1 Like