Download next.js/test/e2e/app-dir/app-static/app/api/draft-mode/route.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/app/api/draft-mode/route.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-static/app/api/draft-mode/route.ts
-
curl -L -o route.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/app/api/draft-mode/route.ts
363 Bytes
| import { draftMode } from 'next/headers' | |
| import { NextRequest, NextResponse } from 'next/server' | |
| export async function GET(req: NextRequest) { | |
| const status = req.nextUrl.searchParams.get('status') | |
| if (status === 'enable') { | |
| ;(await draftMode()).enable() | |
| } else { | |
| ;(await draftMode()).disable() | |
| } | |
| return NextResponse.json({ | |
| status, | |
| }) | |
| } | |