Bläddra i källkod

fix(api): harden resources base url extraction and add debug log

unknown 3 dagar sedan
förälder
incheckning
47f37cf71e
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      src/lib/api.ts

+ 2 - 1
src/lib/api.ts

@@ -1,7 +1,8 @@
 import i18n from "../i18n";
 
 export const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000';
-export const RESOURCES_BASE_URL = API_BASE_URL.replace(/\/api$/, '');
+export const RESOURCES_BASE_URL = API_BASE_URL.replace(/\/api\/?$/, '');
+console.log("DEBUG: Resources will be loaded from:", RESOURCES_BASE_URL);
 
 const getErrorMessage = async (response: Response, defaultMsg: string) => {
   try {