FAQ: Middleware - Request And Response Parameters

This community-built FAQ covers the “Request And Response Parameters” exercise from the lesson “Middleware”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn Express

FAQs on the exercise Request And Response Parameters

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

We just learned that in order to progress to the next middleware line for processing, we need to use the next() function in part 4. All routes as well as app.use statements are considered middleware, but there is an app.use statement at the top of app.js that doesn’t seem to hinder the execution of the other middleware lines without next(). This line specifically:

app.use(express.static(‘public’));

Also, we always declare a port for the server to listen on (usually 4001), but I noticed that the exercise browser defaults to port 8000 and that seems to work just fine. In fact I changed it to a bunch of other port numbers (ex. ‘http://localhost:23456/beans’) and they all work fine, so what is the purpose of specifying the port?

I’m not fully getting the best of this lesson. I’m completing the tasks ok, and able to move to ‘next’, but the browser doesn’t do anything!

What are we supposed to be doing here - what path are we inputting - /beans; /beans/; beans or something completely different?? Nothing I enter works (ie I get no response at all) and refreshing the browser does diddly-squat.

I’m relying on the code and just trusting it, without seeing it actually working in situ…

Anybody else have the same issue?

1 Like

Yes, I have the same issue. I don’t know what the site on the right side of the screen is supposed to do, so when the exercise says “it should work” or “it won’t work”, I don’t know how to check that. What should it do when it works? What is a valid path to enter? No clue.

1 Like

Hello, I faced the same problem so I tried it locally in Visual Studio Code and it worked well.
I could see a message from the first middle-ware on every request.