Class: ResourceEnumerate

@aofl/resource-enumerate~ ResourceEnumerate

Resource enumerate is a special case API call that returns the interface of the API code in a single endpoint. The response can contain server time, paths to resources, and other information based on application needs. An advantage of this technique is that it eliminates the need to hardcode paths\urls.

new ResourceEnumerate(environment)

Creates an instance of ResourceEnumerate.
Parameters:
Name Type Description
environment String
Source:

Members


<static, readonly> NAMESPACE :String

Type:
  • String
Source:

Methods


after(fn)

after hook. Allows to execute some logic immediately after the network call is made.
Parameters:
Name Type Description
fn function
Source:

before(fn)

before hook. Allows to execute some logic right before the network call is made.
Parameters:
Name Type Description
fn function
Source:

<async> get(apiNs, _fromCache)

get() returns a promise that once resolved contains the payload from the resource enumerate call.
Parameters:
Name Type Default Description
apiNs String
_fromCache Boolean true
Source:
Returns:
Type
Promise

<async> init({apis, [, skipEnvironmentCheck])

init() updates apis.url based on supplied config object.
Parameters:
Name Type Argument Default Description
{apis, Object developmentConfig, stageConfig}
skipEnvironmentCheck Boolean <optional>
true skip dev/stage config process
Source:
Returns:
Type
Promise