20 lines
570 B
JavaScript
20 lines
570 B
JavaScript
/**
|
|
* API / WebSocket base URLs for local dev and production.
|
|
* 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(
|
|
import.meta.env.VITE_API_URL || branding.siteUrl
|
|
);
|
|
|
|
export const WS_BASE_URL = trimTrailingSlash(
|
|
import.meta.env.VITE_WS_URL || `wss://${branding.domain}/ws`
|
|
);
|
|
|
|
export const SITE_BASE_URL = trimTrailingSlash(
|
|
import.meta.env.VITE_SITE_URL || branding.siteUrl
|
|
);
|