restore frontend session

This commit is contained in:
Yisroel Baum 2026-07-31 11:05:05 +03:00
parent 24f437cac6
commit bc62a25a8e
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
11 changed files with 146 additions and 14 deletions

View file

@ -0,0 +1,17 @@
function resolveApiBase(): string {
const configuredApiUrl = import.meta.env.VITE_API_URL
if (configuredApiUrl === '') {
throw new Error('VITE_API_URL must be configured')
}
if (!import.meta.env.DEV) {
return configuredApiUrl
}
const apiUrl = new URL(configuredApiUrl)
apiUrl.hostname = window.location.hostname
return apiUrl.origin
}
export const API_BASE = resolveApiBase()