ychris
April 10, 2021, 7:40pm
1
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
ychris
April 10, 2021, 8:01pm
3
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
ychris
April 11, 2021, 6:34am
5
The result am still having is this:
// running tests
The /now endpoint should return a time that is +/- 20 secs from now
// tests completed
ILM
April 11, 2021, 7:17am
6
make sure your system time is correct
seems same issue as here
So I have a stupid problem…
Basically, (I think) my repl code is working right, but my system time on my computer is offset by some amount of time, and I can’t fix it (school computer loaned to me). (I am assuming the fcc website depends on my computers time)
So, I need someone to either tell me how to fix my issue with the system time or to see if my code is wrong.
Your project link(s)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (…
1 Like
ychris
April 18, 2021, 12:58pm
7
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
});
}
);
ychris
April 18, 2021, 1:25pm
8
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.
ychris:
“/now”,
Also, in the future make sure to disable smart quotes because it will interfere with the tests.
1 Like
system
Closed
October 18, 2021, 3:26am
10
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.