# Configuration and Shutdown

Configuration and Shutdown: Configuration Checked at Startup, Graceful Shutdown and Health Checks.

Updated: November 19, 2026

1. [Configuration Checked at Startup](https://www.ask-codey.com/lessons/node-pro-configuration) (Journeyman): An API reads every setting it needs in one config module that checks them all with Zod when the server starts, so a missing or mistyped setting stops it at once with a message naming each problem, and NODE_ENV, an .env file and the host's own settings decide the values in each place it runs.
2. [Graceful Shutdown and Health Checks](https://www.ask-codey.com/lessons/node-pro-graceful-shutdown-and-health) (Freelancer): A host stops your API with SIGTERM on every deploy, so a graceful shutdown stops taking new requests, lets the ones in progress finish with server.close, then closes MongoDB, and a /health route answers 200 or 503 so the host knows whether to send the API riders.

Source: https://www.ask-codey.com/courses/nodejs-in-depth/topics/node-config-and-shutdown
