Skip to content

Commit b77de8a

Browse files
authoredMar 25, 2025··
Update external docs (#1843)
1 parent 3926b29 commit b77de8a

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed
 

‎_includes/readmes/body-parser.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $ npm install body-parser
5151
## API
5252

5353
```js
54-
var bodyParser = require('body-parser')
54+
const bodyParser = require('body-parser')
5555
```
5656

5757
The `bodyParser` object exposes various factories to create middlewares. All
@@ -404,10 +404,10 @@ top-level middleware, which will parse the bodies of all incoming requests.
404404
This is the simplest setup.
405405

406406
```js
407-
var express = require('express')
408-
var bodyParser = require('body-parser')
407+
const express = require('express')
408+
const bodyParser = require('body-parser')
409409

410-
var app = express()
410+
const app = express()
411411

412412
// parse application/x-www-form-urlencoded
413413
app.use(bodyParser.urlencoded())
@@ -429,16 +429,16 @@ need them. In general, this is the most recommended way to use body-parser with
429429
Express.
430430

431431
```js
432-
var express = require('express')
433-
var bodyParser = require('body-parser')
432+
const express = require('express')
433+
const bodyParser = require('body-parser')
434434

435-
var app = express()
435+
const app = express()
436436

437437
// create application/json parser
438-
var jsonParser = bodyParser.json()
438+
const jsonParser = bodyParser.json()
439439

440440
// create application/x-www-form-urlencoded parser
441-
var urlencodedParser = bodyParser.urlencoded()
441+
const urlencodedParser = bodyParser.urlencoded()
442442

443443
// POST /login gets urlencoded bodies
444444
app.post('/login', urlencodedParser, function (req, res) {
@@ -459,10 +459,10 @@ All the parsers accept a `type` option which allows you to change the
459459
`Content-Type` that the middleware will parse.
460460

461461
```js
462-
var express = require('express')
463-
var bodyParser = require('body-parser')
462+
const express = require('express')
463+
const bodyParser = require('body-parser')
464464

465-
var app = express()
465+
const app = express()
466466

467467
// parse various different custom JSON types as JSON
468468
app.use(bodyParser.json({ type: 'application/*+json' }))

‎_includes/readmes/serve-static.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
[![NPM Version][npm-version-image]][npm-url]
44
[![NPM Downloads][npm-downloads-image]][npm-url]
5-
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
6-
[![Windows Build][appveyor-image]][appveyor-url]
5+
[![CI][github-actions-ci-image]][github-actions-ci-url]
76
[![Test Coverage][coveralls-image]][coveralls-url]
87

98
## Install
@@ -243,8 +242,6 @@ function setCustomCacheControl (res, file) {
243242

244243
[MIT](LICENSE)
245244

246-
[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/serve-static/master?label=windows
247-
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static
248245
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master
249246
[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master
250247
[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux

0 commit comments

Comments
 (0)
Please sign in to comment.