Timestamp hints

Hi, I would love some clarity on the tests of this project.
Could I get a hint in the right direction, as I am able to pass the tests manually but not via FCC?
code >>> GitHub - Bponthemove/Bponthemove.fcc-timestamp.io

Many thanks,

Bram

Your project link(s)

solution: https://obscure-tor-39976.herokuapp.com

Your browser information:

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

Challenge: Timestamp Microservice

Link to the challenge:

If you open your dev tools on the network tab when running the test inside FCC you will see a bunch of failed request all due to CORS error.

If you look at the FCC starter code there’s this piece of code baked in for you:

// enable CORS (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)
// so that your API is remotely testable by FCC 
var cors = require('cors');

So I’d say in order to make your app testable you need to enble cors.
Here’s the official express CORS documentation.

Hope this helps :sparkles:

Thank you for your response. I have completely changed it and used the template provided by FCC (instead of doing it from scratch) and not changed a thing apart from the two get requests to get the timestamp and some styling. It still gives all the CORS (type: XHR) errors. Could it have anything to do with my browser settings?

The deployment (on Heroku) had its settings as (region: USA). I have now deleted that one and deployed the same one again with its settings as (region: Europe). Now its passing all the tests.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.