frontend: use /api subpath instead of subdomain

Because buying certificates with multiple SANs every time you want to
deploy an envrionment is a pain the ass and expensive.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-01-30 10:54:14 +01:00
parent 4c47f0b711
commit 79fb06a950
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
const { port, hostname } = window.location;
let hostAndPort = `api.${hostname}`;
let hostAndPort = hostname;
let protocol = 'https';
if (/^\d+\./.test(hostname) || hostname === 'localhost') {
@ -11,7 +11,7 @@ if (/^\d+\./.test(hostname) || hostname === 'localhost') {
protocol = 'http';
}
let url = `${protocol}://${hostAndPort}/v1.0`;
let url = `${protocol}://${hostAndPort}/api/v1.0`;
if (process.env.REACT_APP_BACKEND_BASE_URL) {
url = process.env.REACT_APP_BACKEND_BASE_URL;
}