Methods
_ERROR(err, options) → {string}
Creates a formatted error response message and converts to XML
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
err |
* | Error data to be included in error response. If err is an instanceof Error or has a .message property it is assumed that the .message property is the only thing to include in error response |
||||||||||||||||||||
options |
Object | Configurable options for error XML formatting Properties
|
- Source:
Returns:
Returns the rendered XML string or the err argument if options.skip_conversion is true
- Type
- string
_ERROR(err, options) → {Object}
Creates a formatted error response object
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
err |
* | Any data to be sent as part of error response |
||||||||||
options |
Object | Configurable options for error response formatting Properties
|
- Source:
Returns:
Formatted error response object
- Type
- Object
_ERROR(err, options, cb)
Renders an HTML error page template
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
err |
Object | If err is an instanceof Error or has a .message property only the error message will be included |
||||||||||
options |
Object | Configurable options for error template rendering see _RENDER for further details on options Properties
|
||||||||||
cb |
function | Callback function |
- Source:
_RENDER(data, options) → {string}
Creates a formatted success message and converts to XML
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
* | Any data to be included in XML response |
||||||||||||||||||||
options |
Object | Configurable options for XML response generation Properties
|
- Source:
Returns:
Returns the rendered XML string or the data argument if options.skip_conversion is true
- Type
- string
_RENDER(data, options) → {Object}
Creates a formatted success response object
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
* | Any data that should be sent with the success response |
||||||||||
options |
Object | Configurable options for success response formatting Properties
|
- Source:
Returns:
Formatted success response object
- Type
- Object
_RENDER(data, options, cb)
Renders an HTML string from provided data
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object | Template data should conform to EJS template by default or custom templating engine |
||||||||||||||||||||||||||||||||||||||||
options |
Object | Configurable options for the rendering of HTML string Properties
|
||||||||||||||||||||||||||||||||||||||||
cb |
function | Callback function |
- Source:
findValidViewFromPaths(_default, dirsopt) → {Object}
Iterates through an array of file paths resolving after it finds a valid path or resolves with the default value
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
_default |
string | A default value to resolve if no provided file path is valid |
||
dirs |
Array.<string> |
<optional> |
[] | File paths to check for validity (file exists) |
- Source:
Returns:
Returns a Promise which resolves with a file path or the default value
- Type
- Object