Back End Development and APIs Projects - Timestamp Microservice

Tell us what’s happening:

app.get(“/api”, (req,res)=> {
var resDate = new Date();
res.json({ unix: resDate.valueOf(), utc: resDate.toUTCString()
})})

the last two test didnt pass

###Your project link(s)

solution: https://3000-freecodecam-boilerplate-xithh8gx4u9.ws-us110.gitpod.io

githubLink: GitHub - Dheena5248D/boilerplate-project-timestamp: A boilerplate for a freeCodeCamp project.

Your browser information:

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

Challenge Information:

Back End Development and APIs Projects - Timestamp Microservice

Your current code is passing for me so it seems you fixed it.

BTW, you need to add a return to your conditional responses to avoid the “Cannot set headers after they are sent to the client” errors.