From 967537756c634a38db3974fad27ecee175866b6c Mon Sep 17 00:00:00 2001 From: vamshikrishnaramasamy Date: Tue, 26 May 2026 23:09:42 -0700 Subject: [PATCH] docs(adapter-node): list which env vars custom servers must implement --- documentation/docs/25-build-and-deploy/40-adapter-node.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/documentation/docs/25-build-and-deploy/40-adapter-node.md b/documentation/docs/25-build-and-deploy/40-adapter-node.md index 347396904790..5718378926db 100644 --- a/documentation/docs/25-build-and-deploy/40-adapter-node.md +++ b/documentation/docs/25-build-and-deploy/40-adapter-node.md @@ -273,3 +273,7 @@ app.listen(3000, () => { console.log('listening on port 3000'); }); ``` + +> [!NOTE] When you use `handler.js` in a custom server, only the environment variables read by the handler itself take effect: `ORIGIN`, `PROTOCOL_HEADER`, `HOST_HEADER`, `PORT_HEADER`, `ADDRESS_HEADER`, `XFF_DEPTH`, and `BODY_SIZE_LIMIT`. +> +> The server-lifecycle variables (`PORT`, `HOST`, `SOCKET_PATH`, `SHUTDOWN_TIMEOUT`, `IDLE_TIMEOUT`, `KEEP_ALIVE_TIMEOUT`, `HEADERS_TIMEOUT`, `LISTEN_PID`, `LISTEN_FDS`) are only honored by the default `node build` server. Implement them yourself in a custom server if you need the same behavior — for example, the snippet above listens on a hardcoded `3000` regardless of `PORT`.