mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This enhances the current parsing completed by Next.js of configuration from app segments. Previously a collection of fragile checks was used to parse the different segment configuration options which performed no validation on the inputs. This uses the `zod` library (which we already use internally) to perform validation on the configuration exported. A followup PR #70480 will add more verbose error logging around the validation errors.
28 lines
606 B
JavaScript
28 lines
606 B
JavaScript
export const runtime = 'edge'
|
|
|
|
export default async function Page() {
|
|
const data = await fetch(
|
|
new Request('https://next-data-api-endpoint.vercel.app/api/random', {
|
|
method: 'POST',
|
|
})
|
|
).then((res) => res.text())
|
|
|
|
const data2 = await fetch(
|
|
new URL('https://next-data-api-endpoint.vercel.app/api/random'),
|
|
{
|
|
method: 'POST',
|
|
next: {
|
|
revalidate: 0,
|
|
},
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
return (
|
|
<>
|
|
<p id="page">/variable-revalidate-edge/post-method</p>
|
|
<p id="page-data">{data}</p>
|
|
<p id="page-data2">{data2}</p>
|
|
</>
|
|
)
|
|
}
|