This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getCharacters() { | |
// Simulate 3 seconds of network latency | |
await new Promise((resolve) => setTimeout(resolve, 3000)); | |
const res = await fetch("http://localhost:4000/characters", { | |
headers: { | |
"Content-Type": "application/json", // Indicate that we're expecting JSON | |
}, | |
next: { | |
revalidate: 0, // Next.js specific fetch option to opt out of cache |