← Node.js & Express learning pathNode.js & Express · Module 10 of 10
Testing and deploying Node apps
Test your API, then run it reliably in production.
📖 Key ideas
- Unit test with Jest or Vitest; API test with Supertest.
- Use nodemon in development, not production.
- Process managers (PM2) or containers (Docker) keep apps running.
- Deploy to Render, Railway, AWS, Google Cloud Run or a VPS.
- Log errors and monitor health with a /health endpoint.
💡 Real-life example: PM2 is a night guard: if the app falls asleep (crashes), it wakes it up again.
SupertestTests HTTP endpoints
PM2Node process manager
Health checkEndpoint showing the app is alive
NODE_ENVSets development or production mode