React/Node API calls

0

I am doing a simple get call from a react app running in the preview browser using ip:8080 to my server running node on ip:8080. However i got some error -> Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://f9cc4b267c344e66a483383ae011af19.vfs.cloud9.eu-central-1.amazonaws.com/test. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 499.

I understand the browser is not running on the localhost and uses a proxy. However, is there a way to connect without going through a public internet and open the security group to anyware?

Michael
preguntada hace 6 meses219 visualizaciones
2 Respuestas
0

If you are running your app from local machine, trying to reach an api on aws, traffic will go to the internet, unless you have a Direct connect or VPN bewtween you local environment and aws.

profile picture
EXPERTO
respondido hace 6 meses
0

No. thats not the issue. Let me clarify the architecture. I am running the client (Cloud 9 preview browser) and server (Cloud 9 Ec2) instance. I am running both in Cloud9 but still get a connects refused / Cors error? Thanks for your help.

Michael
respondido hace 6 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas