Files
JJ KasperandGitHub abc74fb92e Update revalidate handling for app (#49062)
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)

---------
2023-05-02 08:19:02 -07:00

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 })
}