Tell us what’s happening:
i have passed all the tests on this project but the project is not marked that i have completed it. what should i do?
this is my code(const isInvalid = (date) => date.toUTCString() === “Invalid Date”;
// your first API endpoint…
app.get(“/api/:date”, function (req, res) {
let date = new Date(req.params.date);
if (isInvalid(date)) {
date = new Date(+req.params.date);
}
if (isInvalid(date)) {
res.json({error: “Invalid date”})
return;
}
res.json({
unix: date.getTime(),
utc: date.toUTCString()
});
});
app.get(“/api”, (req, res) => {
res.json({
unix: new Date().getTime(),
utc: new Date().toUTCString()
})
})
###Your project link(s)
solution: https://3000-freecodecam-boilerplate-k1xis71p13r.ws-us115.gitpod.io
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0
Challenge Information:
Back End Development and APIs Projects - Timestamp Microservice