Skip to content

Commit

Permalink
Merge pull request #346 from JulianKniephoff/configurable-proxy-port
Browse files Browse the repository at this point in the history
Make the port the client proxy proxies to configurable
  • Loading branch information
ziegenberg authored May 9, 2024
2 parents 5fc6c50 + b44b796 commit 0aa6db5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------------------
Expand Down Expand Up @@ -111,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?
docs, which ones?
4 changes: 3 additions & 1 deletion app/src/setupProxy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { createProxyMiddleware } = require("http-proxy-middleware");

const port = process.env.PROXY_PORT || 5000;

module.exports = function (app) {
app.use(
[
Expand All @@ -14,7 +16,7 @@ module.exports = function (app) {
"/ui",
],
createProxyMiddleware({
target: "http://localhost:5000",
target: `http://localhost:${port}`,
changeOrigin: true,
}),
);
Expand Down

0 comments on commit 0aa6db5

Please sign in to comment.