This is a Next.js project bootstrapped with create next-app --example with-patternfly
.
next build
creates an optimized production build of your application. The output displays information about each route.next dev
starts the application in development mode with hot-code reloading, error reporting, and more.next export
allows you to export your app to static HTML, which can be run standalone without the need of a Node.js server.next start
starts the application in production mode. The application should be compiled with next build first.
"scripts": {
"dev": "next",
"build": "next build && next export",
"start": "next start",
"start-build": "yarn build & yarn start",
"clean": "rm -rf .next/ out/ node_modules/",
"cypress:start": "yarn run cypress open",
"cypress:start-build": "concurrently --names 'CYPRESS,SERVER' --prefix-colors 'yellow,blue' \"yarn cypress:start\" \"yarn start-build\"",
"typedoc:build": "node_modules/.bin/typedoc --tsconfig .",
"typedoc:start": "npx serve docs"
}
dev
- Runsnext dev
which starts Next.js in development modebuild
- Runsnext build && next export
which builds the application for production usagestart
- Runsnext start
which starts a Next.js production serverstart-build
- Runsbuild
thenstart
clean
- Slims the directorycypress:start
- Runs cypress as a standalone clientcypress:start-build
- Runs cypress concurrently with a production buildtypedoc:build
- Runs typedoc to generate docstypedoc:start
- Serves the docs
Run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
Create an optimized production build of your application:
npm run build
# or
yarn build
Start the application in production mode:
npm run start
# or
yarn start
- Next.js Deployment - learn about Next.js deployment.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.