From c08e0c0f6065e88a3843b8b50b0046d57d5ac084 Mon Sep 17 00:00:00 2001 From: EnameEtavir <84581448+EnameEtavir@users.noreply.github.com> Date: Mon, 24 May 2021 07:44:40 +0200 Subject: [PATCH] add REACT_APP_PLATFORM_PORT for development (#1411) * add REACT_APP_PLATFORM_PORT for development Add development REACT_APP_PLATFORM_PORT env variable to createClient.getPlatformURL so that you can more easily run more stash platform services at once during development. If non is given, it falls back to standard port "9999". --- README.md | 1 + ui/v2.5/src/core/createClient.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fd80fc78b..f601919f3 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ NOTE: The `make` command in Windows will be `mingw32-make` with MingW. * `make fmt-check` - Ensure changed files are formatted correctly * `make it` - Run the unit and integration tests * `make validate` - Run all of the tests and checks required to submit a PR +* `make ui-start` - Runs the UI in development mode. Requires a running stash server to connect to. Stash port can be changed from the default of `9999` with environment variable `REACT_APP_PLATFORM_PORT`. ## Building a release diff --git a/ui/v2.5/src/core/createClient.ts b/ui/v2.5/src/core/createClient.ts index b1b8eba66..ce976be77 100644 --- a/ui/v2.5/src/core/createClient.ts +++ b/ui/v2.5/src/core/createClient.ts @@ -74,7 +74,7 @@ export const getPlatformURL = (ws?: boolean) => { const platformUrl = new URL(window.location.origin); if (!process.env.NODE_ENV || process.env.NODE_ENV === "development") { - platformUrl.port = "9999"; // TODO: Hack. Development expects port 9999 + platformUrl.port = process.env.REACT_APP_PLATFORM_PORT ?? "9999"; if (process.env.REACT_APP_HTTPS === "true") { platformUrl.protocol = "https:";