FreeCodeCamp not accepting Code

I have checked my API for the output and it is giving the same output as their test API. But none of my tests are passing.

app.get("/api/timestamp/", function(request, response) {
var date= new Date();
var res={unix:, utc :new Date().toUTCString() };
app.get("/api/timestamp/:date", function(request, response) {

var regrex=/^[0-9]{1,16}$/;
var dateTime=parseInt(;
var date=new Date(dateTime);
console.log(date+ “Date matched regex”);
var resp={unix: dateTime, utc : date.toUTCString()}
else {
var date=new Date(;

if(date==“Invalid Date” )
var error={error:date.toString()};
else {
var unixTime= (new Date(date));
var seconds=unixTime.getTime();
console.log(date+ “Date not matched regex”);
var resp={unix: seconds, utc : date.toUTCString()};


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

APIs and Microservices Projects - Timestamp Microservice

Does the solution in this thread work for you?

Thank You. All the tests have passed successfully. I have also taken a note and looked into the CORS package. Thanks a ton <3