From b8efe987af86cad1a117bfc2455ec2aca8c870a7 Mon Sep 17 00:00:00 2001 From: mudabbir-ahmad Date: Mon, 6 Apr 2026 20:08:01 +0100 Subject: [PATCH] Update API base URL comment for home network usage; simplify fetch request handling --- src/components/API/API.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/API/API.js b/src/components/API/API.js index b6d1ab3..7b10cc3 100644 --- a/src/components/API/API.js +++ b/src/components/API/API.js @@ -1,4 +1,5 @@ -export const API_BASE_URL = 'http://api.bobby.ip-ddns.com'; +export const API_BASE_URL = 'http://api.bobby.ip-ddns.com'; //For outside Home network +//export const API_BASE_URL = 'http://192.168.8.100:3000'; //For when im home (API Endpoint is on my home server...) const API = {}; API.get = (endpoint) => callFetch(endpoint, 'GET'); @@ -21,10 +22,7 @@ const callFetch = async (endpoint, method, dataObj = null) => { // Call the fetch and process the return try { let result = null; - const controller = new AbortController(); - const timeoutId = setTimeout(() => controller.abort(), 10000); - const response = await fetch(endpoint, {...requestObj, signal: controller.signal}); - clearTimeout(timeoutId); + const response = await fetch(endpoint, requestObj); if (response.status !== 204) result = await response.json(); return response.status >= 200 && response.status < 300 ? {isSuccess: true, result}