react-code-dataset / next.js /test /e2e /app-dir /app-static /app /route-handler /revalidate-360 /route.js
Download next.js/test/e2e/app-dir/app-static/app/route-handler/revalidate-360/route.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 584 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/app/route-handler/revalidate-360/route.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-static/app/route-handler/revalidate-360/route.js
-
curl -L -o route.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/app/route-handler/revalidate-360/route.js
584 Bytes
| import { NextResponse } from 'next/server' | |
| export const revalidate = 0 | |
| 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 }) | |
| } | |