A friend created a Rest API in Genexus, which was written to Java. We are using Gnok to serve your files from the local machine without the need to pay for a private VPS.
However, when I try to consume their endpoints from my web application made in React, I get the following error:
Access to fetch at 'https://9f64-2800-a4-2933-4100-60e8-3344-52b6-563d.sa.ngrok.io/nortscapeJavaEnvironment/rest/wsGetEmpresas' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: 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.
I think it is something that should be solved from the server to be able to support different request origins, but how can we do it in GeneXus/Java?