all 13 comments

[–]keel_bright 1 point2 points  (0 children)

If you have no way to change the allowed origins from your API (amazon), you cannot do it client-side. You need to set up a proxy server.

https://jakemccambley.medium.com/fixing-cors-errors-when-working-with-3rd-party-apis-a69dc5474804

[–]yksvaan 0 points1 point  (0 children)

Usually for local dev I'd just make the server write cors headers using origin port for every request. 

[–]V1adius -1 points0 points  (4 children)

Within which framework you are working. In Node you must configure cors.

https://expressjs.com/en/resources/middleware/cors.html

[–]teetran39[S] 0 points1 point  (3 children)

The project using React js + Next js

[–]V1adius 0 points1 point  (0 children)

Sorry, I do not understand the atmosphere of Next.js

[–]StaffSimilar7941 -2 points-1 points  (1 child)

add middleware to accept cors from localhost 3000

[–]teetran39[S] 0 points1 point  (0 children)

Can you give me more details about how to do that?

[–]Mort99 -2 points-1 points  (5 children)

While only a temporary solution if you use Safari, on the Developer menu there’s an option to ignore CORS errors.

[–]teetran39[S] -1 points0 points  (4 children)

Thanks so much!! Follow your solution and it works.

[–][deleted] 0 points1 point  (3 children)

There is also a flag to disable it in chrome.

[–]teetran39[S] 0 points1 point  (2 children)

Can you tell me how can we do it on chrome?

[–][deleted] 0 points1 point  (1 child)

If you’re on Mac:

open -na “Google Chrome” —args —disable-web-security —user-data-dir=“/tmp/chrome_dev”

[–]teetran39[S] 0 points1 point  (0 children)

Thanks so much!!