diff --git a/static/script.js b/static/script.js index c2ee618..9586de4 100644 --- a/static/script.js +++ b/static/script.js @@ -1,6 +1,6 @@ // Memory Module Detection QA Interface JavaScript -const API_BASE_URL = 'http://localhost:5001'; +const API_BASE_URL = 'http://localhost:5002'; let uploadedFile = null; // Initialize the application @@ -288,8 +288,16 @@ async function testHardcodedImage() { showLoading('Testing hardcoded image...'); try { + console.log(`Making request to: ${API_BASE_URL}/detect/hardcoded?confidence=0.8`); const response = await fetch(`${API_BASE_URL}/detect/hardcoded?confidence=0.8`); + console.log('Response status:', response.status); + + if (!response.ok) { + throw new Error(`HTTP ${response.status}: ${response.statusText}`); + } + const result = await response.json(); + console.log('Response data:', result); hideLoading(); if (result.success) { @@ -299,6 +307,7 @@ async function testHardcodedImage() { } } catch (error) { hideLoading(); + console.error('Hardcoded test error:', error); alert(`Error: ${error.message}`); } } diff --git a/test_api.py b/test_api.py index e354d1e..e2c155b 100644 --- a/test_api.py +++ b/test_api.py @@ -12,7 +12,7 @@ from PIL import Image import io # API base URL -BASE_URL = "http://localhost:5001" +BASE_URL = "http://localhost:5002" def test_api_info(): """Test the API info endpoint."""