Dear friends! I made my Random Quote Machine in IDE (Atom, Webstorm). When I created a pen in CodePen.io I had a trouble with fetch data from http-source:
Access to fetch at ‘https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1’ from origin ‘https://s.codepen.io’ has been blocked by CORS policy: The ‘Access-Control-Allow-Origin’ header has a value ‘https://cdpn.io’ that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
I sent 3 days to try solving this problem.
If you have the same error, just add “https://cors-anywhere.herokuapp.com/” before your link in fetch.
You can see my pen this.
I hope it can help somebody.