Skip to content

Configuration

The bundle takes one option per sub-plugin. Each is either a config object (forwarded to that sub-plugin), true (enabled with defaults), or false (disabled).

typescript
router.use(basic({
    body: { json: { limit: '1mb' } },
    cookie: true,
    query: false, // skip query parsing entirely
}));

Options

body

Forwarded to the body plugin. See body — configuration for the full option set.

Forwarded to the cookie plugin. See cookie — helpers (Options) for the available config.

query

Forwarded to the query plugin.

Example: parse JSON only

typescript
router.use(basic({
    body: {
        json: { limit: '512kb' },
        urlEncoded: false,
    },
}));

Released under the MIT License.