Created
August 7, 2022 00:52
-
-
Save szaranger/66f61ad05a7f4410ae7ad31028d1de77 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