asset.server Property Definitions
You can use this callback method to create or override APIs and pages. Thereby, you can use this method to define the URL structure of the app. The following properties are returned from the asset.server
callback method:
Property | Description |
---|---|
| An array of API endpoints |
| An array of page endpoints |
Example 1 - Defining a set of pages and APIs
The following code snippet shows how the asset.server
callback method is used to define a set of pages and APIs.
endpoints: { apis: [{ url: 'assets', path: 'assets.jag' }], pages: [{ title: 'Asset: ' + type, url: 'asset', path: 'asset.jag' }, { title: 'Assets ' + type, url: 'assets', path: 'assets.jag' }, { title: 'Create ' + type, url: 'create', path: 'create.jag', }, { title: 'Update ' + type, url: 'update', path: 'update.jag', }, { title: 'Details ' + type, url: 'details', path: 'details.jag' }, { title: 'List ' + type, url: 'list', path: 'list.jag', }, { title: 'Lifecycle', url: 'lifecycle', path: 'lifecycle.jag', }] }
endpoint
 property definitions
The following are the properties that correspond to an endpoint:
Property | Description |
---|---|
| The name that is used as the title of the page. |
| The URL pattern against which requests are matched. |
| The path to the controller that services requests. If the the endpoint is a page, the path to the |
| Whether an authentication process takes place before a user is allowed to access a page or API. If this property is not specified, then ES assumes that the endpoint is publicly accessible. This is an optional property. |