Merge branch '13748-api-host-configuration'
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Mon, 9 Jul 2018 13:24:27 +0000 (15:24 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Mon, 9 Jul 2018 13:24:27 +0000 (15:24 +0200)
refs #13748

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

.env [new file with mode: 0644]
README.md
src/common/api/server-api.ts

diff --git a/.env b/.env
new file mode 100644 (file)
index 0000000..13aaad5
--- /dev/null
+++ b/.env
@@ -0,0 +1,5 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+# 
+# SPDX-License-Identifier: AGPL-3.0
+
+REACT_APP_ARVADOS_API_HOST=https://qr1hi.arvadosapi.com
\ No newline at end of file
index eaed189471536f0a90efc8bebe71b9df6e28c7e9..864a54fa89a122aab17afffa18d9828e3de0c050 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,6 +26,14 @@ yarn install
 yarn build
 </pre>
 
+### Configuration
+You can customize project global variables using env variables. Default values are placed in the `.env` file.
+
+Example:
+```
+REACT_APP_ARVADOS_API_HOST=localhost:8000 yarn start
+```
+
 ### Licensing
 
 Arvados is Free Software. See COPYING for information about Arvados Free
index 2e676dde5c4a5ae76aa5ed4a71319d5eb1740351..330ce657e23bb5cb54a21ecf4a5e82d135446348 100644 (file)
@@ -4,7 +4,7 @@
 
 import Axios, { AxiosInstance } from "axios";
 
-export const API_HOST = 'https://qr1hi.arvadosapi.com';
+export const API_HOST = process.env.REACT_APP_ARVADOS_API_HOST;
 
 export const serverApi: AxiosInstance = Axios.create({
     baseURL: API_HOST + '/arvados/v1'