Fix API port mismatch and improve error handling
This commit is contained in:
+10
-1
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user