Tell us what’s happening:
The dreaded " Chain Middleware to Create a Time Server" page! I’ve gone through a lot of the forum posts on this and most of the trouble seems to be with getting the time right and having to alter the computers time to get it to work but… I can’t even get the first test to pass - “The /now endpoint should have mounted middleware”
*I am on Mac OSX 10.14.5
*Using Chrome
*My time was an hour ahead (In the UK) but even after changing the time back an hour it didn’t change anything.
FWIW, I have copied other answers (which passed other users) in without any luck.
I don’t know if the other code from previous lessons affects it in any way but I’ve put this code first in the editor.
I’ve also tried commenting out the other code and trying it with and it doesn’t make a difference.
Your code so far
var express = require(‘express’);
var app = express();
app.get(’/now’, function(req, res, next) {
req.time = new Date().toString();
next();
}, function(req, res) {
return res.json({‘time’: req.time});
});
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
.
Challenge: Chain Middleware to Create a Time Server
Link to the challenge: