/view

The XYZ View API module export the view method required to request application views from the workspace.

View templates maybe localised and must be requested from the languageTemplates utility module.

Requires

Methods

(async, inner) view(req, res)

The View API method will request a view [template] from the languageTemplates module method.

The optional params.msg string property may have a languageTemplate which should be assigned to the params string before the substitution of template variables.

The view [template] is a HTML string. Template variables defined within a set of brackets {{var}} will be substituted with params property values before the view string is sent from the HTTP Response object.

Parameters:
NameTypeDescription
reqreq

HTTP request.

resres

HTTP response.

Properties
NameTypeAttributesDefaultDescription
req.paramsObject<optional>

Request params.

params.templatestring<optional>
"default_view"

The view template reference.

params.msgstring<optional>

The view template reference.

params.userObject<optional>

Requesting user.