Next.js application with server-side rendering (SSR) for ShipNode deployment.
- Server-side rendering (SSR)
- React Server Components
- Standalone output for deployment
- App Router (Next.js 14+)
pnpm install
pnpm devServer runs on http://localhost:3000
nextjs-app/
├── src/
│ ├── app/
│ │ ├── layout.tsx
│ │ ├── page.tsx
│ │ └── api/
│ │ └── health/
│ │ └── route.ts
├── next.config.js
├── package.json
├── shipnode.conf
└── README.md
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
};
module.exports = nextConfig;The output: 'standalone' creates a minimized build that can run without the full Next.js server.
// src/app/api/health/route.ts
export async function GET() {
return Response.json({ status: 'ok' });
}APP_TYPE=backend
SSH_USER=root
SSH_HOST=your-server-ip
REMOTE_PATH=/var/www/nextjs-app
PM2_APP_NAME=nextjs-app
BACKEND_PORT=3000
DOMAIN=yourdomain.comshipnode deployNext.js with output: 'standalone' runs as a Node.js server:
- SSR routes - Rendered on request
- API routes - Work as expected
- Static routes - Can be pre-rendered