Essential session storage is required to sign in. Optional analytics remain off unless you allow them.
Build an HTTP API in Node (raw http or Express/Fastify) that is production-shaped: configuration from environment variables with sane defaults and fail-fast on missing required ones, a /health endpoint, centralized error handling that distinguishes operational from programmer errors, and — the core requirement — graceful shutdown: on SIGTERM/SIGINT it stops accepting new connections, drains in-flight requests, closes resources, then exits within a timeout.
SIGTERM/SIGINT stops new connections, drains in-flight requests, closes resources, exits within a timeout.
All config from env with defaults; fail-fast on missing required vars; no secrets hardcoded.
Central error handler; operational vs programmer errors distinguished; unhandledRejection/uncaughtException handled.
A /health endpoint; structured-enough logs to debug; sensible status codes.
Use this README structure to make the work reviewable.
DevPath fetches a read-only, size-capped snapshot. Submitted code is never executed.
# A production HTTP service with graceful shutdown ## Goal Build an HTTP API in Node (raw http or Express/Fastify) that is production-shaped: configuration from environment variables with sane defaults and fail-fast on missing required ones, a /health endpoint, centralized error handling that distinguishes operational from programmer errors, and — the core requirement — graceful shutdown: on SIGTERM/SIGINT it stops accepting new connections, drains in-flight requests, closes resources, then exits within a timeout. ## Acceptance criteria - [ ] Graceful shutdown: SIGTERM/SIGINT stops new connections, drains in-flight requests, closes resources, exits within a timeout. - [ ] Config & env: All config from env with defaults; fail-fast on missing required vars; no secrets hardcoded. - [ ] Error handling: Central error handler; operational vs programmer errors distinguished; unhandledRejection/uncaughtException handled. - [ ] Health & ops: A /health endpoint; structured-enough logs to debug; sensible status codes. ## Verification - [ ] Document installation and run commands. - [ ] Record automated checks and their exact commands. - [ ] Add representative output, screenshots, or a short demo where useful. - [ ] Confirm failure paths and known constraints. ## Decision log ### Decision title - Context: - Choice: - Alternatives considered: - Tradeoffs: ## Evidence - Link each rubric criterion to the file, test, or artifact that demonstrates it. ## Known limitations - List what is intentionally out of scope and what should be improved next.