From 92c761fa06237d1acede72ebfb536576206785f7 Mon Sep 17 00:00:00 2001 From: Julian Kniephoff Date: Mon, 6 May 2024 18:32:26 +0200 Subject: [PATCH 1/2] Make the port the client proxy proxies to configurable --- README.md | 12 ++++++++++++ app/src/setupProxy.js | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb640e357d..1a6b4054dd 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,19 @@ Alternatively you can spin up a mock instance of the admin ui with: This uses mock data instead of a real Opencast. This means certain features will not work when using this mode. +### Alternative ports +The static file server and the proxy server serve their content +on the port 5000. If this is used already (as it is on macOS) +you can specify an alternative port in the `PORT` environment variable, +for example: + + PORT=5001 npm run proxy-server ... + +Note that you need to specify the same port when running the client, +this time in the `PROXY_PORT` variable: + + PROXY_PORT=5001 npm run client How to cut a release for Opencast --------------------------------- diff --git a/app/src/setupProxy.js b/app/src/setupProxy.js index 5118929185..693d5a3cb8 100644 --- a/app/src/setupProxy.js +++ b/app/src/setupProxy.js @@ -1,5 +1,7 @@ const { createProxyMiddleware } = require("http-proxy-middleware"); +const port = process.env.PROXY_PORT || 5000; + module.exports = function (app) { app.use( [ @@ -14,7 +16,7 @@ module.exports = function (app) { "/ui", ], createProxyMiddleware({ - target: "http://localhost:5000", + target: `http://localhost:${port}`, changeOrigin: true, }), ); From b44b7966e4e19ff98b9ccf3d8ab37b7f31d950d1 Mon Sep 17 00:00:00 2001 From: Julian Kniephoff Date: Mon, 6 May 2024 18:39:17 +0200 Subject: [PATCH 2/2] Add a missing newline --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a6b4054dd..49d666446a 100644 --- a/README.md +++ b/README.md @@ -123,4 +123,4 @@ Configuration ------------- The Admin UI frontend cannot be directly configured. Rather, it adapts to the various configurations in the Opencast backend. TODO: Throw in some links to the -docs, which ones? \ No newline at end of file +docs, which ones?