Tell us what’s happening:
in an exercise of a course on API and microservices I am asked to create a time server. I do this as you can see, but a message appears: <The / now endpoint must return a time which is +/- 20 seconds from now>. Help me please
Your code so far
app.get(’/now’, function(req, res, next) {
req.time = new Date().toString();
next();
}, function(req, res) {
res.json({
time: req.time
});
});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
.
Challenge: undefined
Link to the challenge: