feat: allow backend URL override via env var

This commit is contained in:
michael 2025-11-20 09:01:14 -06:00
parent 502cf5b61b
commit 56a7251b47

View file

@ -137,6 +137,16 @@ export const getApiConfig = () => {
throw new Error('Configuration not loaded. Call loadConfig() first.');
}
// Check for environment variable override
if (process.env.REACT_APP_BACKEND_URL) {
const backendUrl = process.env.REACT_APP_BACKEND_URL.replace(/\/$/, ''); // Remove trailing slash if present
console.log('ConfigLoader: Using backend URL from env:', backendUrl);
return {
videoProcessingEndpoint: `${backendUrl}/api/process`,
chunkedUploadEndpoint: backendUrl
};
}
return cachedConfig.api || {};
};