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

Tell us what’s happening:
Describe your issue in detail here.

Hi I am trying the following code every thing seems fine but this seem to not pass the second test " The /now endpoint should return the current time."

app.get(
“/now”,
(req, res, next) => {
req.time = new Date().toString();
next();
},
(req, res) => {
res.send({
time: req.time
});
}
);

Really appreciate your help

Your project link(s)

solution: boilerplate-express - Replit

Your browser information:

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

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

Link to the challenge:

Your code is passing for me.

I think it should work no matter the timezone but daylight savings is often an issue with the tests involving date/time. Make sure you are not close to midnight when you submit the code.

I tried again its seems not working btw i am coding in replit. here is the link Join Faraz-SohaibSoh's "boilerplate-express" - Replit. Please have a look at it.

I just submitted the live link to your repl into the challenge and it passed.

Can you share the URL i will try this is strange

https://boilerplate-express.faraz-sohaibsoh.repl.co

So that link just doesn’t pass the linked challenge for you?
It would be better to understand if there’s something causing it to fail at your end, like browser extensions etc.

Can you share the URL i will try this is strange

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