-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi-test.html
More file actions
39 lines (35 loc) · 1.23 KB
/
api-test.html
File metadata and controls
39 lines (35 loc) · 1.23 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
37
38
39
<!DOCTYPE html>
<html>
<head>
<title>API Test</title>
</head>
<body>
<h1>VideoCraft API Test</h1>
<button onclick="testAPI()">Test Analysis API</button>
<div id="result"></div>
<script>
async function testAPI() {
const resultDiv = document.getElementById('result');
resultDiv.innerHTML = 'Testing...';
try {
const response = await fetch('http://127.0.0.1:8002/api/analyze/analyze-filename', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
filename: 'test.mp4'
})
});
console.log('Response status:', response.status);
const result = await response.json();
console.log('Result:', result);
resultDiv.innerHTML = '<pre>' + JSON.stringify(result, null, 2) + '</pre>';
} catch (error) {
console.error('Error:', error);
resultDiv.innerHTML = 'Error: ' + error.message;
}
}
</script>
</body>
</html>