RSSHub-Radar
RSSHub-Radar copied to clipboard
fetch API issue- code: 'UND_ERR_CONNECT_TIMEOUT'
export default async function Page() { try { const response = await fetch('https://rsshub.app/api/radar/rules, { next: { revalidate: 10 }, // Set revalidation interval if needed });
if (!response.ok) {
throw new Error('Failed to fetch data');
}
const data = await response.json();
console.log(data); // You can log the fetched data
return (
<div>
<h1>Fetched Data</h1>
<pre>{JSON.stringify(data, null, 2)}</pre>
</div>
);
} catch (error) { console.error('Error fetching data:', error); return
Failed to fetch data
;
}
}
想知道怎么回事