-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_frontend.js
More file actions
29 lines (25 loc) · 845 Bytes
/
test_frontend.js
File metadata and controls
29 lines (25 loc) · 845 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
// Native Fetch (Node 18+)
async function testFetch() {
try {
console.log('Fetching /api/ratios...');
const res = await fetch('http://localhost:3000/api/ratios');
if (!res.ok) {
console.log(`Failed: ${res.status} ${res.statusText}`);
return;
}
const data = await res.json();
console.log('Success! Data keys:', Object.keys(data));
if (data.data) {
console.log('data.data keys:', Object.keys(data.data));
if (data.data.assets) console.log('data.data.assets found!');
}
if (data.assets) {
console.log('Assets found:', Object.keys(data.assets));
} else {
console.log('WARNING: No assets in root');
}
} catch (e) {
console.error('Fetch Error:', e);
}
}
testFetch();