Skip to content

Instantly share code, notes, and snippets.

@szaranger
Created August 6, 2022 10:58
Show Gist options
  • Save szaranger/5789aeb1a7d86e1f1d10b79a31fd11e5 to your computer and use it in GitHub Desktop.
Save szaranger/5789aeb1a7d86e1f1d10b79a31fd11e5 to your computer and use it in GitHub Desktop.
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