Created
August 6, 2022 10:58
-
-
Save szaranger/5789aeb1a7d86e1f1d10b79a31fd11e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Page = ({ data }) => <div>{data}</div>; | |
export const getServerSideProps = async () => { | |
const res = await fetch('https://path/to/your/api'); | |
const data = await res.json(); | |
return { props: { data } }; | |
}; | |
export default Page; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment