Download next.js/bench/vercel/benchmark-app/pages/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 410 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/bench/vercel/benchmark-app/pages/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/bench/vercel/benchmark-app/pages/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/bench/vercel/benchmark-app/pages/index.js
410 Bytes
| if (!('hot' in Math)) Math.hot = false | |
| export default function page({ hot }) { | |
| return `${hot ? 'HOT' : 'COLD'}` | |
| } | |
| export async function getServerSideProps() { | |
| const wasHot = Math.hot | |
| Math.hot = true | |
| // crash the server after responding | |
| if (process.env.CRASH_FUNCTION) { | |
| setTimeout(() => { | |
| throw new Error('crash') | |
| }, 700) | |
| } | |
| return { | |
| props: { | |
| hot: wasHot, | |
| }, | |
| } | |
| } | |