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
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.
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.