mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
09f9c8a758
https://github.com/vercel/next-js-mirror/pull/150 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
820 B
JavaScript
29 lines
820 B
JavaScript
export const revalidate = 3600
|
|
|
|
export function generateStaticParams() {
|
|
return [{ rest: ['seed'] }]
|
|
}
|
|
|
|
export default async function AppCachePage({ params }) {
|
|
const { rest } = await params
|
|
const captured = `ordinary-bound-value:${rest.join('/')}`
|
|
|
|
// A closure-bound "use server" action. Its presence makes `next build` emit
|
|
// server-reference-manifest.json (with an encryptionKey), which is the private
|
|
// file the traversal later discloses.
|
|
async function harmlessBoundAction(formData) {
|
|
'use server'
|
|
return `${captured}:${formData.get('value')}`
|
|
}
|
|
|
|
return (
|
|
<main>
|
|
<p id="app-rest">{rest.join('/')}</p>
|
|
<form action={harmlessBoundAction}>
|
|
<input name="value" defaultValue="harmless" />
|
|
<button type="submit">submit</button>
|
|
</form>
|
|
</main>
|
|
)
|
|
}
|