This is a Next.js project bootstrapped with create-next-app
.
First, 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.tsx
. 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.ts
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
- Install npm.
sudo apt update
sudo apt install npm
- Add NodeSource repository.
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
- Install Node.js.
sudo apt install -y nodejs
$ node -v
v18.16.1
$ npm -v
9.5.1
- Install Nginx.
sudo apt-get install nginx
- Setting Nginx.
cd /etc/nginx/sites-available/
sudo chmod u+w default
sudo vi default
- Start Nginx.
sudo systemctl start nginx
- Create Next App.
cd
npx create-next-app@12.3.4 --typescript
- Install npm module.
cd ./src-3.2
npm i sass
npm i react-intersection-observer
- Install tmux.
sudo apt-get install tmux
- Start tmux.
tmux
Ctrl + b, "
Control + b, ↑
tmux a -t 0
- Start project.
npm run build
npm start
- Restart Nginx.
sudo systemctl restart nginx