Module: urls

URLs

Source:

Members

(inner, constant) ENVIRONMENT_URLS :string

Enum for RewardOps environment URLs.

Type:
  • string
Properties:
Name Type Description
DEVELOPMENT string

Development

QA string

Quality assurance

INTEGRATION string

Integration

UAT string

User acceptance testing

PRODUCTION string

Production

Source:

Methods

(inner) getApiBaseUrl(options) → {string}

Get the current RewardOps API base URL, based on the API server URL and the currently configured apiVersion in module:config.

Parameters:
Name Type Description
options object

Base URL objects

Properties
Name Type Attributes Description
apiServerUrl string <optional>

API server URL (defaults to derived server URL)

apiVersion string <optional>

API version (defaults to configured apiVersion)

Source:
See:
Returns:

Returns RewardOps API base URL

Type
string

(inner) getApiServerUrl() → {string}

Get the current hostname URL for the RewardOps server. Used in constructing the apiBaseUrl.

Based, in order, on either:

  1. the apiServerUrl setting from module:config~DefaultConfig; or,
  2. a REWARDOPS_ENV Node environment variable (case-insensitive; see module:urls~ENVIRONMENT_URLS).

If neither has a known value, the production server URL is returned.

Source:
Returns:

Returns RewardOps server hostname URL

Type
string
Examples
ro.config.init({ ...restOfConfig, apiServerUrl: 'http://localhost:3000 })
// REWARDOPS_ENV=qa npm start
// REWARDOPS_ENV=development npm start
// REWARDOPS_ENV=DEVELOPMENT npm start