Squashed 'spiffworkflow-frontend/' changes from d68d521d7..790d267b9

790d267b9 support calling backend with a domain name w/ burnettk

git-subtree-dir: spiffworkflow-frontend
git-subtree-split: 790d267b9ec1c757c5a5170eac965b23619f52c8
This commit is contained in:
burnettk 2022-10-17 17:18:24 -04:00
parent a087961fab
commit 8d86fe710d
1 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,11 @@
const host = window.location.hostname;
export const HOST_AND_PORT = `${host}:7000`;
export const BACKEND_BASE_URL = `http://${HOST_AND_PORT}/v1.0`;
let hostAndPort = `api.${host}`;
let protocol = 'https';
if (/^\d+\./.test(host) || host === 'localhost') {
hostAndPort = `${host}:7000`;
protocol = 'http';
}
export const BACKEND_BASE_URL = `${protocol}://${hostAndPort}/v1.0`;
export const PROCESS_STATUSES = [
'not_started',