Next.js Website
Getting Started
git clone https://github.com/cosmicjs/next.js-website
cd next.js-website
yarn
Get your Bucket keys from Cosmic
- Install the app demo content in Cosmic. Click Select App add and follow the steps to install.
- Go to Bucket Settings > API Access to get your Bucket slug and read key.
Run in development with your Bucket keys
COSMIC_BUCKET=your-bucket-slug \
COSMIC_READ_KEY=your-bucket-read-key \
yarn run development
Run in production
COSMIC_BUCKET=your-bucket-slug \
COSMIC_READ_KEY=your-bucket-read-key \
yarn start
Open http://localhost:3000.
Benefits
Next.js
Next.js is a gift to the React community. Building React universal applications is not an easy task and the Next.js framework has greatly simplified the process. Some immediate benefits include:
- Less boilerplate for managing code reuse between server and client.
- Get up and going with your development environment instantly with hot-reloading.
- Simplified paging.
... see more on their GitHub page.
Cosmic
Cosmic is a perfect backend to manage your Next.js React Universal application.
- Query each page easily using the Cosmic NPM Module.
- No CMS boilerplate to configure, fast and easy setup.
- No updates or security updates required.
... see more on the Cosmic website.