Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7940a18

Browse files
committed
docs: include express.json example in using middleware page
1 parent0e581e1 commit7940a18

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

‎_includes/api/en/4x/express.json.md‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,3 @@ The following table describes the properties of the optional `options` object.
4040
|`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`|
4141

4242
</div>
43-
44-
####Example: Different limits for specific routes
45-
46-
```js
47-
// Limit 5MB for /upload
48-
app.use('/upload',express.json({ limit:'5mb' }))
49-
50-
// Default limit for other routes
51-
app.use(express.json())

‎_includes/api/en/4x/express.static.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,13 @@ var options = {
9393

9494
app.use(express.static('public', options))
9595
```
96+
<h4id='example.of.express.json'>Example of express.json</h4>
97+
98+
Here is an example of using the`express.json` middleware function with a custom limit:
99+
100+
```js
101+
// Apply a 5MB limit for /upload requests
102+
app.use('/upload',express.json({ limit:'5mb' }))
103+
104+
// Use default limit for all other routes
105+
app.use(express.json())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp