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

Tell us what’s happening:

app.get(‘/now’,
(req, res, next) => {
req.time = new Date().toString();
next();
},
(req, res) => {
res.json({ time: req.time });
}
);
why is this code not passing the test

###Your project link(s)

solution: https://3000-freecodecam-boilerplate-us401sb406e.ws-us117.gitpod.io

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

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

Your code passes for me.

Are you running it on Gitpod or locally?

You could try using toUTCString and see if that changes anything.

thank you, I was making a silly mistake. I was sending the request to /new endpoint in the local browser :sweat_smile: