new Application(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | Object containing the properties listed below |
Properties:
Name | Type | Description |
---|---|---|
api |
Object | Object containing the api (models, requests, controllers, services) |
components |
Object | Object containing the components (Adapters and ViewEngines) |
config |
Object | Object containing the configuration objects |
env |
String | String representing the runtime environment |
Members
-
server :Object|undefined
-
The server property of the default connection. Please refer to the frontend-communicator module for more information.
Type:
- Object | undefined
Methods
-
connect(connection) → {Promise.<Object>}
-
Connects a Connection using the frontend-communicator module. Please refer to the frontend-communicator module to read more on this.
Parameters:
Name Type Argument Default Description connection
String <optional>
defaultConnection specified in config/app.js The name of the Connection to connect Returns:
A promise that resolves with a frontend-communicator Connection instance with the provided name- Type
- Promise.<Object>
-
policy(policies, data) → {Promise}
-
Executes one or more policies, see the frontend-policies documentation for more info.
Parameters:
Name Type Argument Default Description policies
String | Array.<String> The policies to execute data
Object <optional>
{} Data/params for the policy 'request' Returns:
A promise that resolves if all policies pass and rejects if one or more don't- Type
- Promise
-
setLocale(locale)
-
Sets the current locale.
Parameters:
Name Type Argument Default Description locale
String <optional>
defaultLocale specified in config/app.js The locale to set - To Do:
-
- implement
-
translate(wordPath, data) → {String}
-
Gets a translation in the current locale and fills it with data.
Parameters:
Name Type Description wordPath
String Path to the word, 'general.yes' for example data
Object Object to fill the translation with - To Do:
-
- implement
Returns:
The translation filled with data- Type
- String