Series
Node.js Backend Essentials
CodeSnippets
2 items
Node.js Environment Variable Validation with Zod at Startup
- Nodejs
- Typescript
- 27 May 2026
- 07 Mins read
Most Node.js apps treat process.env like a trusted friend. You reach into it whenever you need a value, assume the key is there, assume it's spelled right, and assume the string is actually the type

Node.js Graceful Shutdown: Handle SIGTERM in Express and Fastify
- Nodejs
- Kubernetes
- 30 Oct 2026
- 06 Mins read
Quick Tip Node's default SIGTERM handler exits immediately, so every deploy kills your in-flight requests. Here's a shutdown handler that drains them properly, in about 80 lines. The Problem