Files
Janka UrygaandGitHub 82e84e430b feat(after): stabilize unstable_after (#73605)
- rename `unstable_after` -> `after`
- remove `experimental.after` flag (and warn if it's present)

i separated the big find-and-replace into a separate commit so that it's
easier to see what else changed apart from that.

does not touch docs, that's in #73038
2024-12-06 19:59:57 +00:00

16 lines
419 B
JavaScript

import { after } from 'next/server'
import { revalidateTimestampPage } from '../../timestamp/revalidate'
import { pathPrefix } from '../../path-prefix'
export const runtime = 'nodejs'
export const dynamic = 'force-dynamic'
export async function GET() {
const data = { message: 'Hello, world!' }
after(async () => {
await revalidateTimestampPage(pathPrefix + `/route`)
})
return Response.json({ data })
}