forked from domdomegg/airtable-mcp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch-test.js
More file actions
21 lines (18 loc) · 680 Bytes
/
Copy pathfetch-test.js
File metadata and controls
21 lines (18 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import nodeFetch from 'node-fetch';
// Test if nodeFetch is a function
console.log('nodeFetch is a function:', typeof nodeFetch === 'function');
// Try to use nodeFetch to make a simple request
async function testFetch() {
try {
console.log('Testing simple fetch request to example.com...');
const response = await nodeFetch('https://example.com');
const status = response.status;
console.log('Fetch request successful:', status);
const text = await response.text();
console.log('Response body length:', text.length);
console.log('Fetch is working properly!');
} catch (error) {
console.error('Error with fetch:', error);
}
}
testFetch();