I wanted to integrate an api but it shows error

Hello, I was trying to fetch data from API but I am getting this error I tried with no-cors mode too. The client is not able to access the API here but I can access the data in a node server. Is there any workaround for this?

WhatsApp Image 2024-01-30 at 13.16.19_f666cf56

Or is there any example project which integrates an API that i can take a reference of?

@yak32

The error says ‘No ‘Access-Control-Origin’ header is present on the requested resource’

This means the issue is on the services/API side that doesn’t allow it to be called from different domains. It works on your Node Server because either its served under the same domain or your local PC.

The APIs/services side needs to configured to allow calls from whatever domain you are requesting from (eg playcanvas.com)

2 Likes

Thanks it has been fixed now :slight_smile: