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
已提問 6 個月前檢視次數 219 次
2 個答案
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
專家
已回答 6 個月前
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
已回答 6 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南