update api_base_url

This commit is contained in:
chris 2025-07-31 10:50:55 -04:00
parent e493c3816e
commit f7e8eb9be3

View File

@ -66,8 +66,7 @@
// --- API Calls --- // --- API Calls ---
// MODIFIED: This now points to the full server address, including the port. // MODIFIED: This now points to the full server address, including the port.
const API_BASE_URL = `http://${window.location.hostname}:3000/api`; const API_BASE_URL = `${window.location.protocol}//${window.location.hostname}:3000/api`;
async function apiCall(endpoint, method = 'GET', body = null) { async function apiCall(endpoint, method = 'GET', body = null) {
const headers = { 'Content-Type': 'application/json' }; const headers = { 'Content-Type': 'application/json' };
if (authToken) headers['Authorization'] = `Bearer ${authToken}`; if (authToken) headers['Authorization'] = `Bearer ${authToken}`;