Hola, tengo el siguiente problema a la hora de testear mi desafío.
// ejecutando pruebas El endpoint
/now
debe devolver la hora actual. // pruebas completadas
Mi codigo es:
app.get('/now', (req, res, next) => {
req.time = new Date().toString()
next()
}, (req, res) => {
res.send({ time: req.time })
})
también utilicé res.json({time: req.time})
time lo puse entre comillas dobles, simples y sin.
Cuando hago el test en el browser, funciona perfecto. Me da la hora tal y como se espera.
Where do you have the code? Post a Replit or repo with your code.
Make sure your PC’s time is synced correctly.
Your code is passing for me. Remember to submit the base URL and not the /now
path.
https://boilerplate-express.martinalba.repl.co
When I use the /now path for testing, it works fine. But when I send the link using the correct way (without /now), it still doesn’t work
Did you make sure your PC’s clock is synced properly?
It is in automatic mode, it is the same that other devices such as cell phones, notebooks, TVs. Does it need to be a specific time?
Try forcing a sync, it doesn’t have to be off by much. It has to be within 20 seconds +/- of the server response.