npm init
to generate package.json for our project with minimal information:npm
will ask to confirm the information and the file is saved.pages
directory and our simple page is saved in this location. package.json
file3000
Hello World
message:How to build the project
3000
(the default port):Custom "Document" used to augment your application's<html>
and<body>
tags.
Document
, and define properties like lang
we need to create the file ./pages/_document.js
App.js
allows us to wrap ALL pages in a special wrapper and use a persistent layout across all pages.
Custom error pages - 404/500 Error Handlers
pages/404.js
file. The same thing we can do to handle with a custom page the 500 Error case.