-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.html
More file actions
26 lines (24 loc) · 775 Bytes
/
test_api.html
File metadata and controls
26 lines (24 loc) · 775 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>API Test</title>
</head>
<body>
<h1>API Connection Test</h1>
<button onclick="testConnection()">Test Connection</button>
<pre id="result"></pre>
<script>
async function testConnection() {
const resultDiv = document.getElementById('result');
resultDiv.textContent = 'Testing...';
try {
const response = await fetch('http://localhost:5000/api/health');
const data = await response.json();
resultDiv.textContent = 'Success!\n' + JSON.stringify(data, null, 2);
} catch (error) {
resultDiv.textContent = 'Error: ' + error.message;
}
}
</script>
</body>
</html>