-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-reply.js
More file actions
32 lines (27 loc) · 876 Bytes
/
test-reply.js
File metadata and controls
32 lines (27 loc) · 876 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
27
28
29
30
31
32
// Simple test to verify reply functionality
import fetch from 'node-fetch';
async function testReply() {
try {
console.log('Testing reply endpoint...');
const response = await fetch('http://localhost:5010/api/reply', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
choice: 'yes',
message: 'This is a test reply from the test script'
})
});
const data = await response.json();
console.log('Reply response:', data);
if (data.ok) {
console.log('Reply sent successfully!');
} else {
console.log('Reply failed:', data.error);
}
} catch (error) {
console.error('Error testing reply:', error.message);
}
}
testReply();