Bitte nochmal machen

This commit is contained in:
Timo Knuth 2025-10-08 22:26:33 +02:00
parent e939543f3b
commit f91bfbdd65
3 changed files with 11 additions and 0 deletions

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
# API Base URL for production
# Set this to your production domain when building
VITE_API_BASE_URL=https://annavillesda.org

View File

@ -33,6 +33,10 @@ function resolveImageUrl(value, fallback) {
if (apiBaseUrl) { if (apiBaseUrl) {
return `${apiBaseUrl}${path}` return `${apiBaseUrl}${path}`
} }
// Fallback to current domain if no API base URL is set
if (typeof window !== 'undefined') {
return `${window.location.origin}${path}`
}
return path return path
} }
return fallback return fallback

View File

@ -15,6 +15,10 @@ function resolveImageUrl(value) {
if (apiBaseUrl) { if (apiBaseUrl) {
return `${apiBaseUrl}${path}` return `${apiBaseUrl}${path}`
} }
// Fallback to current domain if no API base URL is set
if (typeof window !== 'undefined') {
return `${window.location.origin}${path}`
}
return path return path
} }