Skip to content

Conversation

@krzysdz
Copy link
Contributor

@krzysdz krzysdz commented Apr 25, 2025

This addresses most of updates to Express 4 API docs that are not present in v5 and were listed in the TODO section of #1881.

All commits reference respective commits/PRs that introduced those changes to 4.x documentation.

@krzysdz krzysdz requested review from a team as code owners April 25, 2025 12:44
@netlify
Copy link

netlify bot commented Apr 25, 2025

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 9b65f5a
🔍 Latest deploy log https://app.netlify.com/sites/expressjscom-preview/deploys/680b83bd8b59b60007ac3b95
😎 Deploy Preview https://deploy-preview-1886--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@krzysdz krzysdz changed the title Api docs pull 4x changes to 5x Update 5x API docs with missing 4x changes Apr 25, 2025
Copy link
Member

@ShubhamOulkar ShubhamOulkar left a comment

Choose a reason for hiding this comment

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

Great, LGTM!👍

<h3 id='req.acceptsLanguages'>req.acceptsLanguages(lang [, ...])</h3>
<h3 id='req.acceptsLanguages'>req.acceptsLanguages([lang, ...])</h3>

Returns the first accepted language of the specified languages,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Returns the first accepted language of the specified languages,
Returns the first accepted language from the specified languages,

app.use(express.json()) // for parsing application/json
app.use(express.urlencoded({ extended: true })) // for parsing application/x-www-form-urlencoded

app.post('/profile', (req, res, next) => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
app.post('/profile', (req, res, next) => {
app.post('/profile', (req, res) => {

Copy link
Member

@ShubhamOulkar ShubhamOulkar Apr 26, 2025

Choose a reason for hiding this comment

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

Change 'Sets cookie name to value.' to 'Sets the cookie with the specified name to the given value.' line no. 3

| `priority` | String | Value of the "Priority" **Set-Cookie** attribute.
| `secure` | Boolean | Marks the cookie to be used with HTTPS only.
| `signed` | Boolean | Indicates if the cookie should be signed.
| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. More information at [https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. More information at [https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1).
| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. See [SameSite cookie specifications](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1) for more details.

Copy link
Member

Choose a reason for hiding this comment

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

I think it is better to use callback instead of fn. And update line 42 for better readability and consistency.
WDYT?

@bjohansebas bjohansebas merged commit 0082552 into expressjs:gh-pages May 1, 2025
7 checks passed
@bjohansebas
Copy link
Member

bjohansebas commented May 1, 2025

@ShubhamOulkar, if you want, you can open a PR with those changes you're proposing.

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.

3 participants