Download next.js/test/production/options-request/app/page.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/options-request/app/page.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/options-request/app/page.tsx
-
curl -L -o page.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/options-request/app/page.tsx
1.1 kB
| 'use client' | |
| export default function Page() { | |
| return ( | |
| <> | |
| <button | |
| onClick={async () => { | |
| const response = await fetch('/app-route', { method: 'OPTIONS' }) | |
| console.log(await response.json()) | |
| }} | |
| > | |
| Trigger Options Request (/app route) | |
| </button> | |
| <button | |
| onClick={async () => { | |
| const response = await fetch('/app-page', { method: 'OPTIONS' }) | |
| console.log(await response.text()) | |
| }} | |
| > | |
| Trigger Options Request (/app page) | |
| </button> | |
| <button | |
| onClick={async () => { | |
| const response = await fetch('/pages-page', { method: 'OPTIONS' }) | |
| console.log(await response.text()) | |
| }} | |
| > | |
| Trigger Options Request (/pages page) | |
| </button> | |
| <button | |
| onClick={async () => { | |
| const response = await fetch('/api/pages-api-handler', { | |
| method: 'OPTIONS', | |
| }) | |
| console.log(await response.text()) | |
| }} | |
| > | |
| Trigger Options Request (/pages API route) | |
| </button> | |
| </> | |
| ) | |
| } | |