Fix 5.x docs drift from 4.x conventions - #2487
Open
BIGSUS24 wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Express 5.x API documentation to reduce drift from the 4.x docs by aligning wording, example formatting, and section ordering.
Changes:
- Update request/response page frontmatter descriptions to use
req/reswording. - Fix the
res.type('png')example output formatting to match the surrounding examples. - Reorder the
req.hostnameandreq.hostsections to match the 4.x documentation sequence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/content/api/5x/api/response/index.mdx | Adjusts frontmatter wording and corrects the res.type() example output. |
| src/content/api/5x/api/request/index.mdx | Adjusts frontmatter wording and reorders req.hostname / req.host sections. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| --- | ||
| title: Request Object | ||
| description: The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on | ||
| description: The req object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on |
| Contains the host derived from the `Host` HTTP header. | ||
|
|
||
| When the [`trust proxy` setting](/api/application/#options-for-trust-proxy-setting) | ||
| When the [`trust proxy` setting](/api/application/#application-settings) |
- res.type() example had a stray trailing colon and missing quotes (image/png: -> 'image/png'), matching every sibling example in that block and the 4.x doc. - Reordered req.host/req.hostname to match 4.x's order (hostname then host); only moved the blocks, didn't touch their content. - Frontmatter description wording changed from "The request/response object..." to "The req/res object..." to match 4.x.
BIGSUS24
force-pushed
the
fix/5x-docs-parity-1881
branch
from
August 10, 2026 18:23
1d26e3d to
06945ab
Compare
This was referenced Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Addresses part of #1881 — the
req.host/req.hostnameordering and page description items, plus theres.type()typo noted inside the comment-style bullet. The broader single-vs-double-quote and// => sthinline-vs-newline comment-placement convention in that same bullet is left for a separate PR since it touches many more lines and is a bigger judgment call.Three small fixes to bring 5.x docs back in line with 4.x conventions:
res.type()typo —res/index.mdxhadres.type('png'); // => image/png:(stray trailing colon, missing quotes). Every sibling example in that block, and the 4.x doc's equivalent line, uses// => 'image/png'. Fixed to match.req.host/req.hostnameorder — 4.x documentsreq.hostnamefirst, thenreq.host(as a deprecated alias). 5.x had them reversed. Reordered to match 4.x; only moved the blocks, didn't touch their content (5.x'sreq.hostlegitimately documents different behavior — it retains the port — so it's correctly not described as a deprecated alias there, unlike 4.x).description— 5.x request/response docs said "The request/response object represents..."; 4.x says "The req/res object represents...". Changed 5.x to match 4.x's wording.No content/behavior claims changed beyond what's listed above — pure ordering + wording + one typo.