update api_base_url
This commit is contained in:
parent
e493c3816e
commit
f7e8eb9be3
@ -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}`;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user