To solve "Chain Middleware to Create a Time Server" challenge

Tell us what’s happening:
Describe your issue in detail here.
I’m trying to solve " Chain Middleware to Create a Time Server" task. However, I can’t.

Your project link(s)

solution: boilerplate-express - Replit
https://boilerplate-express.diegodmitry.repl.co

My Code

const middlewareTime = (req, res, next) => {
  req.time = new Date().toString();
  // const sec = date.getSeconds();
  // req.time = sec;
  // console.log(req.time);
  next();
};

app.get('/now', middlewareTime, (req, res) => {
  res.send({
    time: req.time
  });
});

Your browser information:

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

Challenge: Chain Middleware to Create a Time Server

Link to the challenge:

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