From 11b6d2e5a44e0499d7c8f19be6f8015ea382f49a Mon Sep 17 00:00:00 2001 From: Don McKenzie Date: Tue, 31 Aug 2021 12:05:01 -0400 Subject: [PATCH 1/3] Improve local development CORS handling --- packages/code-studio/.env.development | 10 +++++++--- packages/code-studio/package.json | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/code-studio/.env.development b/packages/code-studio/.env.development index 472169fbc2..b14a209383 100644 --- a/packages/code-studio/.env.development +++ b/packages/code-studio/.env.development @@ -1,7 +1,11 @@ REACT_APP_ENABLE_LOG_PROXY=false -REACT_APP_CORE_API_URL=http://localhost:10000/jsapi -REACT_APP_NOTEBOOKS_URL=http://localhost:10000/notebooks -REACT_APP_LAYOUTS_URL=http://localhost:10000/layouts +REACT_APP_CORE_API_URL=http://localhost:10000/ + +# Proxy set in package.json to handle 4000 to solve CORS +# https://create-react-app.dev/docs/proxying-api-requests-in-development/ +REACT_APP_NOTEBOOKS_URL=http://localhost:4000/notebooks +REACT_APP_LAYOUTS_URL=http://localhost:4000/layouts + REACT_APP_ROUTER_BASE_NAME=/ REACT_APP_INTERNAL_PLUGINS=ExamplePlugin PORT=4000 diff --git a/packages/code-studio/package.json b/packages/code-studio/package.json index 24cea88544..8fc1c43d13 100644 --- a/packages/code-studio/package.json +++ b/packages/code-studio/package.json @@ -122,5 +122,6 @@ ], "publishConfig": { "access": "public" - } + }, + "proxy": "http://localhost:10000" } From 0cc0bf34711063afdc15bdeb320998cc194d3a67 Mon Sep 17 00:00:00 2001 From: Don McKenzie Date: Tue, 31 Aug 2021 12:08:40 -0400 Subject: [PATCH 2/3] whoops --- packages/code-studio/.env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/code-studio/.env.development b/packages/code-studio/.env.development index b14a209383..2e0819aa42 100644 --- a/packages/code-studio/.env.development +++ b/packages/code-studio/.env.development @@ -1,5 +1,5 @@ REACT_APP_ENABLE_LOG_PROXY=false -REACT_APP_CORE_API_URL=http://localhost:10000/ +REACT_APP_CORE_API_URL=http://localhost:10000/jsapi # Proxy set in package.json to handle 4000 to solve CORS # https://create-react-app.dev/docs/proxying-api-requests-in-development/ From 344436c563c9c2605a888edfed1f83d71786bad7 Mon Sep 17 00:00:00 2001 From: Don McKenzie Date: Wed, 1 Sep 2021 15:26:34 -0400 Subject: [PATCH 3/3] drop extra urls entirely --- packages/code-studio/.env.development | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/code-studio/.env.development b/packages/code-studio/.env.development index 2e0819aa42..0a1e9c1f7b 100644 --- a/packages/code-studio/.env.development +++ b/packages/code-studio/.env.development @@ -1,10 +1,8 @@ REACT_APP_ENABLE_LOG_PROXY=false REACT_APP_CORE_API_URL=http://localhost:10000/jsapi -# Proxy set in package.json to handle 4000 to solve CORS +# Proxy set in package.json to handle CORS for other URLs # https://create-react-app.dev/docs/proxying-api-requests-in-development/ -REACT_APP_NOTEBOOKS_URL=http://localhost:4000/notebooks -REACT_APP_LAYOUTS_URL=http://localhost:4000/layouts REACT_APP_ROUTER_BASE_NAME=/ REACT_APP_INTERNAL_PLUGINS=ExamplePlugin