Tell us what’s happening:
Describe your issue in detail here.
The chain method seems to work properly but i am constantly getting error as below.
// running tests
The /now endpoint should have mounted middleware
The /now endpoint should return the current time.
// tests completed
// console output
[Error: Not found]
[Error: Not found]
Below is my code.
app.get('/now', (req, res, next) => {
req.time = new Date().toString();
next();
}, (req, res) => {
res.json({ time: req.time });
});
Your project link(s)
solution: https://boilerplate-npm--ashishmishra96.repl.co
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Challenge: Basic Node and Express - Chain Middleware to Create a Time Server
Link to the challenge: