Basic Node and Express - Chain Middleware to Create a Time Server

Hi i just read all similar problems in the forum and dont know what is the issue
I already tried change the timezone (using momentzone) to solve the problem but nothing is working

Thanks in advance and sorry for the trouble

Your project link(s)

solution: boilerplate-express - Replit

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0

Challenge: Basic Node and Express - Chain Middleware to Create a Time Server

Link to the challenge:

You have an incorrect use of next in the Logger middleware at the top.

app.use(function(next) {
  console.log(next.method + " " + next.path + " - " + next.ip);
  next();
});

Do you pass if you comment that out? I do.


next is the third parameter to the handler (req, res, next). You can not skip parameters and their order is fixed. The names are not significant they are purely convention. Writing function(next) does not magically make next contain something other than when you write function(req)

Yeah i tried comment that line and it works thanks :smiley: , it didnt cross my mind because the last challenge past with that code, was code generate with suggestions so i didnt know…

Thanks for the explanations too

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.