example-frontend-next-js

An example of a Sanity powered frontend using Next.js

Github星跟蹤圖

Sanity + Next.js frontend example

DEMO ? https://example-frontend-next-js.sanity-io.now.sh

This is an example Sanity powered frontend for the movie dataset using Next.js.

Prerequisites

You will need Node.js version 8.0 or greater installed on your system.

Setup

Get the code by either cloning this repository using git

git clone https://github.com/sanity-io/example-frontend-next-js.git

... or downloading source code code as a zip archive.

Once downloaded, open the terminal in the project directory, and install dependencies with:

npm install

If you're running your own Sanity project with the example movie dataset, go to lib/sanity.js and change the following lines:

  projectId: 'YOUR_PROJECT_ID',
  dataset: 'NAME_OF_YOUR_DATASET',

You can locate the ID of your project in the header of the management page for your project.

You also need to enable localhost:3000 in your CORS Origins settings! Either through the management page under settings or by running the below in the project folder you set up with sanity init:

sanity cors add http://localhost:3000

Then start the example app with:

npm run dev

The app should now be up and running at http://localhost:3000 ?

主要指標

概覽
名稱與所有者sanity-io/example-frontend-next-js
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證
所有者活动
創建於2017-11-10 14:14:58
推送於2023-03-18 19:29:45
最后一次提交2022-08-06 07:19:05
發布數0
用户参与
星數222
關注者數6
派生數157
提交數43
已啟用問題?
問題數2
打開的問題數0
拉請求數5
打開的拉請求數3
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?