Data fetch example
Next.js was conceived to make it easy to create universal apps. That's why fetching data on the server and the client when necessary is so easy with Next.js.
By using getStaticProps
Next.js will fetch data at build time from a page, and pre-render the page to static assets.
Deploy your own
Deploy the example using Vercel:
How to use
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app --example data-fetch data-fetch-app
# or
yarn create next-app --example data-fetch data-fetch-app
Deploy it to the cloud with Vercel (Documentation).