next.js/test/development/app-dir/server-components-hmr-cache/lib/fetch-random-value.ts
fetch-random-value.ts8 lines244 B
export async function fetchRandomValue(key: string) {
  const url = new URL('https://next-data-api-endpoint.vercel.app/api/random')
  url.searchParams.set('key', key)
  const res = await fetch(url, { cache: 'no-store' })

  return res.text()
}
Quest for Codev2.0.0
/
SIGN IN