FAQ: Learn Express Routes - Getting A Single Expression

// Use static server to serve the Express Yourself Website
app.use(express.static(‘public’));

I think it’s re-loading the webpage each time ‘app.use’ is called.

@codeacademy This section is poorly explained. What these new terms,( route parameters, params object) mean, and how they are used really needs more clarity. The hint section needs to show the syntax. It would be much more clear if the exercise was analogous to the example, then we could follow the example to figure out the exercise.

This is the first time I’ve been completely lost on how to approach an exercise. :confounded:

Here’s a much better explanation of the content:

(Express Tutorial Part 4: Routes and controllers - Learn web development | MDN)

In the util.js file there is the following code:

const getElementById = (id, elementList) => {
  return elementList.find((element) => {
    return element.id === Number(id);
  });
};

My question is is where does element in elementList.find((element) come from? There is no variable anywhere in the file that is element.

After looking at the other replies and questions I don’t feel so bad for not understanding what I was supposed to do in this exercise. Poorly explained. This needs revision.

yes - I am having trouble making it work on my local vs-code environment and keep seeing cannot Get/ even though I have tested it over and over on the machine and the code appears to be correct. It is a shame that it does not seem to work properly outside of the CA workspace. I am going to look through the discussions to see if there is any light shed. Will try this code too to see if it works: const { getElementById, seedElements } = require(’./utils’); Just thought I would add my thoughts.