Back End Development and APIs Projects - Exercise Tracker

Tell us what’s happening:
I can’t pass The date property of any object in the log array that is returned from GET /api/users/:_id/logs should be a string. Use the dateString format of the Date API.

Although I use the .toStringDate() and my res is something like this
{“username”:“Constantine”,“count”:1,“_id”:“637023e4a86b9bc72f118687”,“log”:[{“description”:“Yes”,“duration”:56,“date”:“Sat Nov 12 2022”}]}

Your project link(s)

solution: boilerplate-project-exercisetracker - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

I just tested yours in the FCC program and it passed (which is a problem since this is the one I’m working on too! I’ll have to pretend I failed until I pass my own :wink: ). Did you fix something?

Nope I am still failing. What’s your locale Europe or US?

I’m in US. Passed right away.

One thing I would note however, that I saw right away: you aren’t using the SECRETS or ENV tab. Your database password is exposed in your index.js file. Very dangerous!

Edit: here’s how I connect to mongo:

const mySecret = process.env['MONGO_URI'];
mongoose.connect(mySecret, { useNewUrlParser: true, useUnifiedTopology: true })
  .then(()=>{console.log("Connected successfully to MongoDB")})
  .catch(err=>{console.log("Connection error.")});

Oops you are right thx

I tried VPN to US but still not passing the tests!

It passes for me as well.

If your local time is close to midnight avoid running the test. It is the only time I have seen issues with tests that rely on time. Do it before 23:00 or after 01:00 (or as far away from midnight as possible).

Just a weird follow up for me on this one–I finished my project and ALSO was passing all tests except for the final date one. I took the night off (I’m on the west coast of US) and booted it up this morning. I passed the final test without making any changes to my code. Maybe something was just a little hinky yesterday on the test server?