Download next.js/test/integration/api-support/pages/api/blog/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 192 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/integration/api-support/pages/api/blog/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/integration/api-support/pages/api/blog/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/integration/api-support/pages/api/blog/index.js
192 Bytes
| export default ({ query, method }, res) => { | |
| if (method === 'POST') { | |
| res.status(200).json([{ title: query.title }]) | |
| } else { | |
| res.status(200).json([{ title: 'Cool Post!' }]) | |
| } | |
| } | |