codebuddies / backend

CodeBuddies back-end
https://codebuddies.org
GNU General Public License v3.0
20 stars 25 forks source link

Unblock cors error on react app running on localhost:3000 #102

Closed lpatmo closed 4 years ago

lpatmo commented 4 years ago

If I have the django and react app running at the same time on localhost:8000 and localhost:3000 respectively, I get a cors error if I try to make requests to localhost:8000/auth/users from the React app:

image

This PR whitelists http://localhost:3000 to prevent the cors error.

lpatmo commented 4 years ago

How do we guarantee that users run the React app on port 3000

Heh, good question. The default is 3000, but folks can definitely specify alternate ports. I'll make sure to document on the React side. Thanks for reviewing!