react-flask-socketio
react-flask-socketio copied to clipboard
Fixed CORS issue at localhost
When I tried to run this project at my localhost, I got an error in web console saying that
http://localhost:3000 is not an accepted origin Access to XMLHttpRequest at 'http://localhost:5001/socket.io/?EIO=3&transport=polling&t=NY2-yMT' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. index.js:83 GET http://localhost:5001/socket.io/?EIO=3&transport=polling&t=NY2-yMT net::ERR_FAILED
So I made some modifications to avoid this issue.
Meanwhile, I also reorganized package.json and requirements.txt to manage packages for both react project and python project.