mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This updates revalidate handling for app and moves some exports from `next/server` to `next/cache` x-ref: [slack thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1682535961644979?thread_ts=1682368724.384619&cid=C042LHPJ1NX) ---------
26 lines
555 B
JavaScript
26 lines
555 B
JavaScript
import { NextResponse } from 'next/server'
|
|
|
|
export async function GET() {
|
|
const data360 = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/random',
|
|
{
|
|
next: {
|
|
revalidate: 360,
|
|
tags: ['thankyounext'],
|
|
},
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
const data10 = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/random?a=10',
|
|
{
|
|
next: {
|
|
revalidate: 10,
|
|
tags: ['thankyounext'],
|
|
},
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
return NextResponse.json({ data360, data10 })
|
|
}
|