export const debugFetch = internalAction({
args: {},
handler: async () => {
const targets = [
{ name: 'httpbin', url: 'https://httpbin.org/get' },
{ name: 'google', url: 'https://www.google.com' },
{ name: 'stripe-root', url: 'https://api.stripe.com' },
{ name: 'stripe-meter', url: 'https://api.stripe.com/v1/billing/meter_events' },
];
for (const { name, url } of targets) {
try {
const res = await fetch(url, { method: 'GET' });
console.log(`[debugFetch] ${name} (${url}): ${res.status} ${res.statusText}`);
} catch (error) {
console.error(`[debugFetch] ${name} (${url}): FAILED -`, String(error));
}
}
},
});
export const debugFetch = internalAction({
args: {},
handler: async () => {
const targets = [
{ name: 'httpbin', url: 'https://httpbin.org/get' },
{ name: 'google', url: 'https://www.google.com' },
{ name: 'stripe-root', url: 'https://api.stripe.com' },
{ name: 'stripe-meter', url: 'https://api.stripe.com/v1/billing/meter_events' },
];
for (const { name, url } of targets) {
try {
const res = await fetch(url, { method: 'GET' });
console.log(`[debugFetch] ${name} (${url}): ${res.status} ${res.statusText}`);
} catch (error) {
console.error(`[debugFetch] ${name} (${url}): FAILED -`, String(error));
}
}
},
});