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}