Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _includes/api/en/4x/express.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ The following table describes the properties of the optional `options` object.
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `json`), a mime type (like `application/json`), or a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"application/json"` |
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |

</div>
</div>
10 changes: 10 additions & 0 deletions _includes/api/en/4x/express.static.md
Copy link
Member

Choose a reason for hiding this comment

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

From what I can see, you made the change in the wrong file, judging by the commit message.

Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,13 @@ var options = {

app.use(express.static('public', options))
```
<h4 id='example.of.express.json'>Example of express.json</h4>

Here is an example of using the `express.json` middleware function with a custom limit:

```js
// Apply a 5MB limit for /upload requests
app.use('/upload', express.json({ limit: '5mb' }))

// Use default limit for all other routes
app.use(express.json())