Skip to content

Commit

Permalink
Fix gitpod port forwarding (redwoodjs#3434)
Browse files Browse the repository at this point in the history
* Try mikes suggestion

* add visibility: public to 8911 port

* add Env Var for Dev API URL

Co-authored-by: David Price <[email protected]>
  • Loading branch information
dac09 and thedavidprice authored Sep 28, 2021
1 parent d5b3c01 commit 8482cce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tasks:
openMode: split-left
init: |
eval $(gp env -e RWFW_PATH="/workspace/redwood")
eval $(gp env -e RWJS_DEV_API_URL="http://localhost")
mkdir /workspace/rw-test-app
command: |
cd /workspace/rw-test-app
Expand All @@ -27,6 +28,7 @@ tasks:
ports:
- port: 8911
onOpen: ignore
visibility: public
- port: 8910
onOpen: notify

Expand Down
4 changes: 3 additions & 1 deletion packages/core/config/webpack.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const baseConfig = merge(webpackConfig('development'), {
port: redwoodConfig.web.port,
proxy: {
[redwoodConfig.web.apiProxyPath]: {
target: `http://[::1]:${redwoodConfig.api.port}`,
target: `${process.env.RWJS_DEV_API_URL ?? 'http://[::1]'}:${
redwoodConfig.api.port
}`,
pathRewrite: {
[`^${escapeRegExp(redwoodConfig.web.apiProxyPath)}`]: '',
},
Expand Down

0 comments on commit 8482cce

Please sign in to comment.