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".
This commit is contained in:
EnameEtavir 2021-05-24 07:44:40 +02:00 committed by GitHub
parent 0e01374537
commit c08e0c0f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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:";