This course is now available as video course in Udemy
mkdir cms
cd cms
npm init -y
npm install next react react-dom
Update package.json
file
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
}
Create pages folder
mkdir pages
cd pages
touch pages/index.js
Write content for home page index.js
// index.js
export default function () {
return <div>Welcome to Next.js!</div>;
}
Run the project
npm run dev
Now visit http://localhost:3000 to see your nextjs app running.