make-sans / developool

An ExpressJS API server consumed by a ReactJS client, which combined create the Developool service
http://developool.com
MIT License
2 stars 0 forks source link

CORS #6

Open Federlizer opened 5 years ago

Federlizer commented 5 years ago

The react client, when deployed on the DigitalOcean server is acting funny. Everything seems to be working on the local copy, however when I try to connect to the DO one and try to open all the projects (which doesn't even require authentication), the client throws an error and a CORS message in the dev console.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5000/api/project. (Reason: CORS request did not succeed).

Federlizer commented 5 years ago

More info: When I was trying to figure out what was going on, it so happened that I was running both the DO server and my localhost server. For whatever reason, the react client from DO was connecting to the localhost express server that I was running.

Federlizer commented 5 years ago

Changing the API_URL to point to the actual IP address of the server fixes the issue. Don't know if I should close this :thinking: