react-code-dataset / react-query /examples /react /nextjs-suspense-streaming /src /app /api /wait /route.ts
Download react-query/examples/react/nextjs-suspense-streaming/src/app/api/wait/route.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 297 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-suspense-streaming/src/app/api/wait/route.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-suspense-streaming/src/app/api/wait/route.ts
-
curl -L -o route.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-suspense-streaming/src/app/api/wait/route.ts
297 Bytes
| import { NextResponse } from 'next/server' | |
| export async function GET(request: Request) { | |
| const { searchParams } = new URL(request.url) | |
| const wait = Number(searchParams.get('wait')) | |
| await new Promise((resolve) => setTimeout(resolve, wait)) | |
| return NextResponse.json(`waited ${wait}ms`) | |
| } | |