Skip to content

Fix 5.x docs drift from 4.x conventions - #2487

Open
BIGSUS24 wants to merge 1 commit into
expressjs:mainfrom
BIGSUS24:fix/5x-docs-parity-1881
Open

Fix 5.x docs drift from 4.x conventions#2487
BIGSUS24 wants to merge 1 commit into
expressjs:mainfrom
BIGSUS24:fix/5x-docs-parity-1881

Conversation

@BIGSUS24

Copy link
Copy Markdown

Addresses part of #1881 — the req.host/req.hostname ordering and page description items, plus the res.type() typo noted inside the comment-style bullet. The broader single-vs-double-quote and // => sth inline-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:

  1. res.type() typores/index.mdx had res.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.
  2. req.host / req.hostname order — 4.x documents req.hostname first, then req.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's req.host legitimately documents different behavior — it retains the port — so it's correctly not described as a deprecated alias there, unlike 4.x).
  3. Frontmatter 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.

Copilot AI lite review requested due to automatic review settings August 10, 2026 18:18
@BIGSUS24
BIGSUS24 requested a review from a team as a code owner August 10, 2026 18:18
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 06945ab
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/6a7a173e5f44bd0008ffd962
😎 Deploy Preview https://deploy-preview-2487--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/res wording.
  • Fix the res.type('png') example output formatting to match the surrounding examples.
  • Reorder the req.hostname and req.host sections 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants