feature flags
This commit is contained in:
@@ -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.'
|
||||
|
||||
Reference in New Issue
Block a user