feature flags

This commit is contained in:
2026-01-07 22:05:53 +01:00
parent 1b63fa646c
commit 606b64cec7
530 changed files with 2092 additions and 2943 deletions

View File

@@ -14,12 +14,15 @@ export function getWebsiteApiBaseUrl(): string {
return normalizeBaseUrl(configured);
}
// In test-like environments, check if we have any configuration at all
const isTestLike =
process.env.NODE_ENV === 'test' ||
process.env.CI === 'true' ||
process.env.DOCKER === 'true';
if (isTestLike) {
// If we're in a test-like environment and have NO configuration, that's an error
// But if we have some configuration (even if empty), we should use the fallback
if (isTestLike && !process.env.API_BASE_URL && !process.env.NEXT_PUBLIC_API_BASE_URL) {
throw new Error(
isBrowser
? 'Missing NEXT_PUBLIC_API_BASE_URL. In Docker/CI/test we do not allow falling back to localhost.'