-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
36 lines (33 loc) · 1.08 KB
/
test.html
File metadata and controls
36 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<title>Test Frontend Fix</title>
</head>
<body>
<script>
async function testAPI() {
try {
const response = await fetch('http://localhost:3001/api/query', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ message: 'I need a router' })
});
const result = await response.json();
console.log('API Response:', result);
if (!result.success) {
console.error('API Error:', result.error);
} else {
console.log('Data:', result.data);
console.log('Intent:', result.data.intent);
console.log('Result:', result.data.result);
}
} catch (error) {
console.error('Network Error:', error);
}
}
testAPI();
</script>
</body>
</html>