mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-05-19 22:26:32 +00:00
Allowing app to run from sub path on the hostname
Signed-off-by: Srinivas Boga <bseenu@gmail.com>
This commit is contained in:
1
client/.env
Normal file
1
client/.env
Normal file
@@ -0,0 +1 @@
|
||||
REACT_APP_ROOT_PATH = $ROOT_PATH
|
||||
@@ -19,10 +19,11 @@ type StreamArgs = {
|
||||
connectCb?: () => void;
|
||||
}
|
||||
|
||||
const ROOT_PATH = process.env.REACT_APP_ROOT_PATH || '';
|
||||
const {hostname, href, hash, search} = window.location;
|
||||
const nonHashedUrl = href.replace(hash, '').replace(search, '').replace('#', '');
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
const BASE_HTTP_URL = isDev && hostname === 'localhost' ? 'http://localhost:4654' : nonHashedUrl;
|
||||
const BASE_HTTP_URL = isDev && hostname === 'localhost' ? `http://localhost:4654${ROOT_PATH}` : `${nonHashedUrl}${ROOT_PATH}`;
|
||||
const BASE_WS_URL = BASE_HTTP_URL.replace('http', 'ws');
|
||||
const JSON_HEADERS = {Accept: 'application/json', 'Content-Type': 'application/json'};
|
||||
const PROTO_HEADERS = {Accept: 'application/vnd.kubernetes.protobuf', 'Content-Type': 'application/json'};
|
||||
|
||||
Reference in New Issue
Block a user