# Graceful Shutdown and Health Checks

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.

![Cheat sheet: Graceful Shutdown and Health Checks](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/fdd817e2e1d8448cbb04dbee8f391e3e.webp)

- Category: Node.js
- Level: Freelancer
- Tags: 503 Service Unavailable, Graceful Shutdown (nodejs), Health Check (rest-api), nodejs, Signal (unix), sigterm, web-development
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/node-pro-graceful-shutdown-and-health-cheat-sheet
