Modernize frontend and centralize branding
This commit is contained in:
1 parent
bc4542d0fb
commit
2d61d80550
55 files changed
+1901
-14446
No files matched your search
+6
-4
@@ -1,17 +1,19 @@
|
||||
/**
|
||||
* API / WebSocket base URLs for local dev and production.
|
||||
* Set REACT_APP_API_URL and REACT_APP_WS_URL in .env (see .env.example).
|
||||
* Set VITE_API_URL, VITE_WS_URL, and VITE_SITE_URL in .env (see .env.example).
|
||||
*/
|
||||
import branding from '../branding';
|
||||
|
||||
const trimTrailingSlash = (url) => (url || '').replace(/\/$/, '');
|
||||
|
||||
export const API_BASE_URL = trimTrailingSlash(
|
||||
process.env.REACT_APP_API_URL || 'https://anchorhost.eu'
|
||||
import.meta.env.VITE_API_URL || branding.siteUrl
|
||||
);
|
||||
|
||||
export const WS_BASE_URL = trimTrailingSlash(
|
||||
process.env.REACT_APP_WS_URL || 'wss://anchorhost.eu/ws'
|
||||
import.meta.env.VITE_WS_URL || `wss://${branding.domain}/ws`
|
||||
);
|
||||
|
||||
export const SITE_BASE_URL = trimTrailingSlash(
|
||||
process.env.REACT_APP_SITE_URL || API_BASE_URL
|
||||
import.meta.env.VITE_SITE_URL || branding.siteUrl
|
||||
);
|
||||
Reference in new issue
Block a user