Skip to content

Update 5x API docs with missing 4x changes #1886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

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 and others added 7 commits April 25, 2025 13:53
expressjs@5c98ee4

Co-authored-by: Douglas Christopher Wilson <doug@somethingdoug.com>
expressjs#1402

Co-authored-by: Jon Ege Ronnenberg <jon.ronnenberg@gmail.com>
expressjs@5e918ea

Co-authored-by: Douglas Christopher Wilson <doug@somethingdoug.com>
expressjs@fcaca7f

Co-authored-by: Douglas Christopher Wilson <doug@somethingdoug.com>
expressjs#1456

Co-authored-by: Rich Hodgkins <rhodgkins@gmail.com>
expressjs@a5ca5b0

Co-Authored-By: Douglas Wilson <doug@somethingdoug.com>
expressjs#1063

Co-Authored-By: Mo <hematy61@gmail.com>
@krzysdz krzysdz requested review from a team as code owners April 25, 2025 12:44
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!👍

@@ -1,7 +1,15 @@
<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