Hi, some one help pass this challenge

I can’t pass the challenge please help.

https://boilerplate-express-1.nanasv.repl.co

solution: https://boilerplate-express-1.nanasv.repl.co

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 8.1.0; itel A16 Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.93 Mobile Safari/537.36.

Challenge: Chain Middleware to Create a Time Server

Link to the challenge:

Hello, @ychris Can you tell us, what problem you have? And please provide the code to us. So we can check on it.

Thank you!

1 Like
var express = require('express');
var app = express();

app.get('/now', (req, res, next)=>{
  
  next();
}, (req, res)=>{
 var time =  new Date();
  console.log('time'+time);
  res.json({'time': time});
}
       );






























 module.exports = app;



































 module.exports = app;

@ychris, I checked on the challenge with your solution link. Somehow it passed.

Did you try refresh on that challenge and apply the solution link on it and submit it?

1 Like

The result am still having is this:

// running tests
The /now endpoint should return a time that is +/- 20 secs from now
// tests completed

make sure your system time is correct

seems same issue as here

1 Like

Looking at the message above I have
to adjust my time, I did but still can’t pass please help.

var express =require ('express ');
var app=express ();

app.get(
  "/now",
  (req, res, next) => {
    req.time = new Date().toString();
    next();
  },
  (req, res) => {
    res.send({
      time: req.time
    });
  }
);
Looking at the message above I have
to adjust my time, I did but still can’t pass please help.

var express =require ('express ');
var app=express ();

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


I ran your solution link and it also passes for me.

Also, in the future make sure to disable smart quotes because it will interfere with the tests.

1 Like

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