11 lines
333 B
JavaScript
11 lines
333 B
JavaScript
export const API_BASE_URL =
|
|
(typeof window !== 'undefined' && window.__ENV__?.API_BASE_URL) ||
|
|
import.meta.env.VITE_API_BASE_URL ||
|
|
'https://api.sovamed.ru'
|
|
|
|
export const apiUrl = (path) => {
|
|
const base = API_BASE_URL.replace(/\/$/, '')
|
|
const suffix = path.startsWith('/') ? path : `/${path}`
|
|
return `${base}${suffix}`
|
|
}
|