waibu | Object | <optional>
| {} | Waibu configuration Properties| Name | Type | Attributes | Default | Description |
|---|
prefix | string | <optional>
| 'api' | Prefix for the Waibu REST API routes |
|
mountMainAsRoot | boolean | <optional>
| true | Whether to mount the main route as root |
exposeHead | boolean | <optional>
| true | Whether to expose the HEAD method |
enablePatch | boolean | <optional>
| false | Whether to enable the PATCH method |
bodyLimit | number | <optional>
| 1048576 | Maximum size of the request body in bytes |
intl | Object | <optional>
| {} | Internationalization configuration Properties| Name | Type | Attributes | Default | Description |
|---|
detectors | Array.<string> | <optional>
| ['qs', 'header'] | List of detectors for internationalization |
|
format | Object | <optional>
| {} | Format configuration Properties| Name | Type | Attributes | Default | Description |
|---|
supported | Array.<string> | <optional>
| ['json', 'xml'] | List of supported formats (e.g., 'json', 'xml') | asExt | boolean | <optional>
| false | Whether to use file extensions for format detection | xml | Object | <optional>
| {} | XML format configuration Properties| Name | Type | Attributes | Default | Description |
|---|
bodyParser | Object | <optional>
| {} | XML body parser configuration Properties| Name | Type | Attributes | Default | Description |
|---|
contentTypes | Array.<string> | <optional>
| ['text/xml', 'application/xml', 'application/rss+xml'] | List of content types for XML body parsing | validate | boolean | <optional>
| false | Whether to validate XML body |
| response | Object | <optional>
| {} | XML response configuration Properties| Name | Type | Attributes | Default | Description |
|---|
wrapper | string | <optional>
| 'doc' | Wrapper element for XML response | declaration | boolean | <optional>
| true | Whether to include XML declaration in response | valueAsAttributes | boolean | <optional>
| true | Whether to treat values as attributes in XML response |
|
|
|
responseKey | Object | <optional>
| {} | Response key mapping configuration Properties| Name | Type | Attributes | Default | Description |
|---|
data | string | <optional>
| 'data' | Key for data in the response | oldData | string | <optional>
| 'oldData' | Key for old data in the response | page | string | <optional>
| 'page' | Key for page number in the response | count | string | <optional>
| 'count' | Key for count | pages | string | <optional>
| 'pages' | Key for total pages | success | string | <optional>
| 'success' | Key for success status | statusCode | string | <optional>
| 'code' | Key for status code | error | string | <optional>
| 'error' | Key for error message | cached | string | <optional>
| 'cached' | Key for cached status | hardCapped | string | <optional>
| 'hardCapped' | Key for hard capped status | message | string | <optional>
| 'message' | Key for message | warnings | string | <optional>
| 'warnings' | Key for warnings | details | string | <optional>
| 'details' | Key for details |
|