Static site (Vite + React) for the CoPaw product. Built output is served with a minimal Node server that supports SPA fallback (e.g. direct access to /docs/channels).
- Node.js 18+
- pnpm (recommended) or npm
pnpm install
# or
npm installpnpm run dev
# or
npm run devDev server runs at http://localhost:5173 (or the next free port).
pnpm run build
# or
npm run buildOutput is in dist/.
-
Vite preview (quick local check):
pnpm run preview -
Production-style server (same as prod, no PM2):
pnpm run preview:prodServesdist/athttp://localhost:8088with SPA fallback.
Use PM2 to run the preview server in production: auto-restart on crash, logs, and easy start/stop.
npm install -g pm2If the script runs without global PM2, it will try to install it automatically.
cd website
pnpm run build
pm2 start ecosystem.config.cjsOr from repo root (install + build + PM2 start/reload):
bash scripts/website_build.shOr use the helper script (installs PM2 if missing, then starts):
bash scripts/start.shDefault port: 8088. Override with PORT=3000 pm2 start ecosystem.config.cjs or by editing ecosystem.config.cjs.
| Command | Description |
|---|---|
pm2 status |
List apps and status |
pm2 logs copaw-website |
Stream stdout/stderr logs |
pm2 restart copaw-website |
Restart the app |
pm2 reload ecosystem.config.cjs --update-env |
Reload with latest config (zero-downtime) |
pm2 stop copaw-website |
Stop the app |
pm2 delete copaw-website |
Remove from PM2 (stop + delete) |
Rebuild then reload so PM2 serves the new dist/:
pnpm run build
pm2 reload ecosystem.config.cjs --update-envOr from repo root:
bash scripts/website_build.sh- Port: Set in
ecosystem.config.cjs(env.PORT/args) or envPORT. Default8088. - App name:
copaw-websiteinecosystem.config.cjs(used inpm2 logs/restart).