forked from Vesting-Vault/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-endpoint.js
More file actions
34 lines (27 loc) · 760 Bytes
/
Copy pathtest-endpoint.js
File metadata and controls
34 lines (27 loc) · 760 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
33
34
// Test script for portfolio endpoint
const http = require('http');
const testAddress = '0x1234567890abcdef1234567890abcdef12345678';
const options = {
hostname: '127.0.0.1',
port: 3000,
path: `/api/user/${testAddress}/portfolio`,
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
};
const req = http.request(options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
console.log('✅ Response Status:', res.statusCode);
console.log('✅ Response Data:');
console.log(JSON.stringify(JSON.parse(data), null, 2));
});
});
req.on('error', (e) => {
console.error('❌ Request Error:', e.message);
});
req.end();