Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 2.58 KB

File metadata and controls

41 lines (26 loc) · 2.58 KB

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.

Preview

Quickly preview this example directly in your browser with StackBlitz:

Open in StackBlitz

🌏 Open in other Cloud IDES

Click any of the buttons below to start a new development environment to demo or contribute to the codebase without having to install anything on your machine:

Open in Glitch Open in GitHub Codespaces Edit in Codesandbox Open in Repl.it Open in Codeanywhere Open in Gitpod

Deploy your own

Deploy the example using Vercel:

Deploy with 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).