Setup nvm and specify node version
nvm use
yarn build
yarn start
Open http://localhost:3000 with your browser to see the frontend app.
If you want to change the startup port, change the PORT
environment variable.
For VMs, the directory to be used must be mapped under /app/imports/ on the VM. A Docker example is shown below.
docker build -t pic-cube-frontend -f docker/Dockerfile.frontend .
docker run -p 3000:3000 -v /volumes/sample-dir:/app/imports/sample-dir pic-cube-frontend
Run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the frontend app.
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.
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.