Skip to content
Flowline

Deployment

Deployment Options

Terminal window
npm i -g vercel
vercel

Build for Production

Terminal window
# Build optimized bundle
npm run build
# Preview production build locally
npm run preview

Environment Setup

Production Variables

.env.production
NODE_ENV=production
API_URL=https://api.myapp.com
DATABASE_URL=postgres://user:pass@host:5432/db

Pre-deployment Checklist

  • Run tests: npm test
  • Build succeeds: npm run build
  • Environment variables configured
  • Database migrations applied
  • SSL certificate configured

Health Checks

health.js
app.get('/health', (req, res) => {
res.json({
status: 'healthy',
uptime: process.uptime(),
timestamp: Date.now(),
});
});

Recommended Always include a health check endpoint for monitoring.

Monitoring

// Log important events
logger.info('Server started', { port: 3000 });
logger.error('Database connection failed', { error });