help me ‘no-cors’ to fetch the resource with CORS disabled

Access to fetch at ‘http://sipla.cuci.udg.mx/sc/horariop.php?c=219359735&k=0d8ce4fab5f4df9ce711cae81e044e1a’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

Hi, I’ve tried to solve this problem for more than a week. I’m new to this meteor. I’m trying to learn by myself even because I do not know English very well.
but I’m trying to access an api that I get this eh encotrado that you should put a message like
Access-Control-Allow-Origin: *
but I do not know how and where
and then I get the promise of “cross-origin”
help I’m crazy
I am from mexico

Do you own the server http://sipla.cuci.udg.mx/? It needs to allow access from localhost in its Access-Control-Allow-Origin header. You can read up on it here

1 Like

This occurs because the cors header on the remote server is not configured to permit direct access from your browser. You can use your Meteor Server as a proxy though, since this only occurs in browser, not server-side. Call the Meteor server with method call, then use Meteor REST package to call the remote URL, then return the response to the client. This isn’t a Meteor problem - you will find the same if you use JS fetch API in a script tag in a simple HTML file.