Deployment
Deploy to Vercel, Docker, or any Node.js host.
Every generated project includes a vercel.json config and can be deployed with Docker or any platform that runs Node.js.
Vercel
The generated vercel.json is ready to go:
{
"version": 2,
"builds": [
{
"src": "dist/server.js",
"use": "@vercel/node",
"config": { "maxDuration": 60, "memory": 1024 }
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/server.js",
"methods": ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]
}
]
}Build the project
npm run buildDeploy
npx vercel --prodSet your environment variables in the Vercel dashboard under Settings > Environment Variables. At minimum, set NODE_ENV=production and DATABASE_URL if you're using a database.
Vercel's serverless functions are stateless. If you're using SQLite, you'll need to switch to PostgreSQL or MySQL for production since SQLite requires a persistent filesystem.
Docker
If you enabled Docker during scaffolding, you already have a Dockerfile and docker-compose.yml. See the Docker page for the full setup.
To deploy with Docker on any host:
docker compose up --build -dFor production, make sure to:
- Set
NODE_ENV=productionin your.env - Use strong passwords for your database
- Place a reverse proxy (nginx, Caddy) in front for TLS
The generated server handles SIGTERM gracefully, so Docker and Kubernetes can shut down containers without dropping in-flight requests.
Railway
Railway auto-detects Node.js projects. Push your code and set the environment variables in the dashboard.
npm run buildSet the start command to node dist/server.js and add your environment variables (NODE_ENV, PORT, DATABASE_URL).
Railway provides managed PostgreSQL and MySQL databases that you can connect directly via DATABASE_URL.
Any Node.js host
The generated project compiles to plain JavaScript. Any platform that runs Node.js 18+ works:
Install and build
npm ci
npm run buildStart the server
NODE_ENV=production node dist/server.jsThe server listens on the port defined by PORT (defaults to 3000). Point your reverse proxy or load balancer at that port.
Environment variables in production
At minimum, set these for any production deployment:
| Variable | Value |
|---|---|
NODE_ENV | production |
PORT | Your host's expected port |
DATABASE_URL | Your production database connection string |
RATE_LIMIT_MAX | Adjust based on expected traffic |
See the Environment Variables page for the full list.