public-env

This commit is contained in:
tonyrewin 2022-11-14 22:01:03 +03:00
parent 4c0cd1b0bb
commit bfd931f98f
2 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@ import { t } from './utils/intl'
// Setting locale for prerendered content here // Setting locale for prerendered content here
const lang = Astro.url.searchParams.get('lang') || 'ru' const lang = Astro.url.searchParams.get('lang') || 'ru'
console.log('[layout] server locale is', lang) console.log('[main.astro] astro runtime locale is', lang)
setLocale(lang) setLocale(lang)
--- ---

View File

@ -1,2 +1,6 @@
export const isDev = import.meta.env.VERCEL_ENV !== 'production' export const isDev = import.meta.env.VERCEL_ENV !== 'production'
export const apiBaseUrl = import.meta.env.API_URL || import.meta.env.VITE_API_URL || 'http://localhost:8080' export const apiBaseUrl =
import.meta.env.PUBLIC_API_URL ||
import.meta.env.API_URL ||
import.meta.env.VITE_API_URL ||
'http://localhost:8080'