Skip to content

Commit

Permalink
Fix GraphQL proxy in dev environments without IPv6 (#8233)
Browse files Browse the repository at this point in the history
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
  • Loading branch information
2 people authored and jtoar committed May 11, 2023
1 parent 87bbaea commit ee384c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ tasks:
openMode: split-left
before: |
export RWFW_PATH="/workspace/redwood"
export RWJS_DEV_API_URL="http://localhost"
init: |
mkdir /workspace/rw-test-app
command: |
cd /workspace/rw-test-app
echo -e "\n\n\033[94m ======================================================" && echo -e "\n\033[33m ⌛ Please wait until the dev server is running on the right-side terminal. \n "rw-test-app" is being generated & linked with latest framework code. \n\nIf you make further changes to the framework..." && echo -e "1. \033[33mEnsure env vars are set \033[92m'export RWFW_PATH="/workspace/redwood" RWJS_DEV_API_URL="http://localhost"'\033[33m" && echo -e "2. \033[33mRun \033[92m'yarn rwfw project:sync'\033[33m to watch & sync changes into the test project" && echo -e "\n\033[94m ======================================================\n\n"
echo -e "\n\n\033[94m ======================================================" && echo -e "\n\033[33m ⌛ Please wait until the dev server is running on the right-side terminal. \n "rw-test-app" is being generated & linked with latest framework code. \n\nIf you make further changes to the framework..." && echo -e "1. \033[33mEnsure env vars are set \033[92m'export RWFW_PATH="/workspace/redwood"'\033[33m" && echo -e "2. \033[33mRun \033[92m'yarn rwfw project:sync'\033[33m to watch & sync changes into the test project" && echo -e "\n\033[94m ======================================================\n\n"
- name: "Dev Servers"
openMode: split-right
before: |
export RWFW_PATH="/workspace/redwood"
export RWJS_DEV_API_URL="http://localhost"
export REDWOOD_DISABLE_TELEMETRY=1
init: |
cd /workspace/redwood
Expand Down
2 changes: 1 addition & 1 deletion packages/core/config/webpack.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const getProxyConfig = () => {
// Redwood only proxies absolute paths.
return {
[apiUrl]: {
target: `${process.env.RWJS_DEV_API_URL ?? 'http://[::1]'}:${port}`,
target: `${process.env.RWJS_DEV_API_URL ?? 'http://localhost'}:${port}`,
pathRewrite: {
// Eg: Rewrite `/.netlify/functions/graphql` to `/graphql`, which the api-server expects
[`^${escapeRegExp(apiUrl)}`]: '',
Expand Down

0 comments on commit ee384c4

Please sign in to comment.