Pool-Of-Tears / SuperHero-Quotes

Restful JSON API consisting huge collection of Marvel & DC SuperHeros and Supervillains quotes!
https://superhero-quotes.herokuapp.com/
MIT License
15 stars 1 forks source link

Facing CORS Policy issue #7

Closed jasmin-merchant closed 2 years ago

jasmin-merchant commented 2 years ago

Hey there!

I love the concept, and the quotes collection is really amazing!

I am building something similar on top of it & was thinking to use the API to get the quotes. However, when I'm using the endpoints in Postman, I'm able to get the response but have been unsuccessful to get any response when trying via JavaScript. It's giving CORS policy issue.

Can you please check or let me know a way to get the data?

Here's a sample code that you could try from any file or Chrome dev tools. Any help would be greatly appreciated!!

fetch("https://akabab.github.io/superhero-api/api/all.json")
.then(response => console.log(response))
.catch(error => console.log('error', error));

Here's a reference of the issue showing:

Screenshot 2022-01-08 at 6 10 09 PM

starry-shivam commented 2 years ago

Hi thanks for your kind feedback! i've tried to fix the problem from API side, can you please try again?

jasmin-merchant commented 2 years ago

Hey thank you so much for acting on it promptly, it worked wonderfully!!! I've updated from my end & now it's loading perfectly.

Btw if you want to check it out, here's the link to it:

https://comiquotes.gatsbyjs.io

starry-shivam commented 2 years ago

Hey thank you so much for acting on it promptly, it worked wonderfully!!! I've updated from my end & now it's loading perfectly.

Btw if you want to check it out, here's the link to it:

https://comiquotes.gatsbyjs.io

Glad to hear that! And really cool work (^^) nice to see people building stuffs on the API!