Shipping Node APIs means hardened config, observability, and safe defaults—not just node main.mjs on a laptop.
Configuration
- Node LTS pinned in
enginesand Docker base image - Secrets via env/secret manager—never in repo
NODE_ENV=productiontoggles framework optimizations- HTTPS at edge; HSTS when stable
Application
- Input validation on every mutating route
- Rate limits on auth and expensive endpoints
- Helmet or equivalent security headers
- Graceful shutdown handling
npm auditin CI; dependabot/Renovate for updates
Operations
- Structured logs with request IDs
- Health and readiness probes
- Metrics and alerting on 5xx latency
- Runbooks for rollback and DB migrations
Self-check
- Why pin Node version in production?
- What belongs on a /health endpoint?