Skip to content

Commit f33cb79

Browse files
authored
Make backend port configurable (stolostron#3344)
Lets users configure a port like 4001 if 4000 is unavailable. Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
1 parent 97f6b1a commit f33cb79

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ A number of the core NPM package dependencies are published from other repositor
8484
8585
This will start the frontend and the backend in parallel. (It may take up to 30 seconds for the UI to appear)
8686
87+
**NOTE:** If a port conflict appears with port `4000`, you can override it by exporting `BACKEND_PORT` with a
88+
new value like `4001` and re-running the setup and start commands
89+
8790
## Running as an OpenShift console plugin-in
8891
8992
See [Dynamic Plugins - Development](frontend/PLUGIN.md#development)

frontend/webpack.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module.exports = function (env: any, argv: { hot?: boolean; mode: string | undef
167167
'/multicloud/username',
168168
'/multicloud/userpreference',
169169
'/multicloud/version',
170-
].map((backendPath) => ({ path: backendPath, target: 'https://localhost:4000', secure: false })),
170+
].map((backendPath) => ({ path: backendPath, target: `https://localhost:${process.env.BACKEND_PORT ?? 4000}`, secure: false })),
171171
open: openBrowser,
172172
historyApiFallback: true,
173173
compress: true,

setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
echo > ./backend/.env
77

8-
echo PORT=4000 >> ./backend/.env
8+
echo PORT="${BACKEND_PORT:-4000}" >> ./backend/.env
99
echo NODE_ENV=development >> ./backend/.env
1010

1111
CLUSTER_API_URL=`oc get infrastructure cluster -o jsonpath={.status.apiServerURL}`

0 commit comments

Comments
 (0)