Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve local development CORS handling #172

Closed
wants to merge 3 commits into from
Closed

Conversation

dsmmcken
Copy link
Contributor

@dsmmcken dsmmcken commented Aug 31, 2021

Avoids CORS problems with layouts/notebooks url by using proxy.

See https://create-react-app.dev/docs/proxying-api-requests-in-development/ for details.

@dsmmcken dsmmcken requested a review from mofojed August 31, 2021 16:09
packages/code-studio/.env.development Outdated Show resolved Hide resolved
@dsmmcken dsmmcken requested a review from mofojed September 1, 2021 19:30
@@ -1,7 +1,9 @@
REACT_APP_ENABLE_LOG_PROXY=false
REACT_APP_CORE_API_URL=http://localhost:10000/jsapi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can take this one out too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried before leaving it in. It won't proxy ws:// so this has to stay.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this thread it's a Chrome only issue: facebook/create-react-app#5280

But we can also fix it by having a src/setupProxy.js file, and adding the ws: true option. facebook/create-react-app#5280 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an easier workaround until that issue is resolved. How about I just drop that ticket number next to it as a comment?

@dsmmcken
Copy link
Contributor Author

dsmmcken commented Sep 2, 2021

supersede by #180

@dsmmcken dsmmcken closed this Sep 2, 2021
@dsmmcken dsmmcken deleted the dmckenzie_local_cors branch September 2, 2021 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants