Remove env-config.js (#9331)

Fixes #5340 which had been open for a long time
This commit is contained in:
Félix Malfait
2025-01-03 15:18:02 +01:00
committed by GitHub
parent 03b1da82c1
commit e5754d2152
7 changed files with 54 additions and 32 deletions

View File

@ -12,12 +12,12 @@ const getDefaultUrl = () => {
) {
// In development environment front and backend usually run on separate ports
// we set the default value to localhost:3000.
// It dev context, we use env vars to overwrite it
// In dev context, we use env vars to overwrite it
return 'http://localhost:3000';
} else {
// Outside of localhost we assume that they run on the same port
// because the backend will serve the frontend
// It prod context, we use env-config.js + window var to ovewrite it
// In prod context, we use index.html + window var to ovewrite it
return `${window.location.protocol}//${window.location.hostname}${
window.location.port ? `:${window.location.port}` : ''
}`;