Parametrize configurations¡

This commit is contained in:
2025-12-24 12:44:34 +01:00
parent a2f21e1286
commit a9baf6da95
8 changed files with 105 additions and 30 deletions

View File

@@ -16,5 +16,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const API_BASE = import.meta.env.VITE_API_BASE || 'http://localhost:8000';
const baseUrl = import.meta.env.BASE_URL || '/';
const defaultApiBase = `${baseUrl.replace(/\/$/, '')}/api`;
const rawApiBase = import.meta.env.VITE_API_BASE || defaultApiBase;
export const API_BASE = rawApiBase.replace(/\/$/, '');
export const ENABLE_POLLING = import.meta.env.MODE !== 'test';