Module

urls

URLs

View Source urls.js, line 1

Members

string

# inner constant ENVIRONMENT_URLS

Enum for RewardOps environment URLs.

Properties:
Name Type Description
DEVELOPMENT string

Development

QA string

Quality assurance

INTEGRATION string

Integration

UAT string

User acceptance testing

PRODUCTION string

Production

View Source urls.js, line 16

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 Attributes Description
options object

Base URL objects

apiServerUrl string <optional>

API server URL (defaults to derived server URL)

apiVersion string <optional>

API version (defaults to configured apiVersion)

See:

View Source urls.js, line 79

Returns RewardOps API base URL

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.

View Source urls.js, line 54

Returns RewardOps server hostname URL

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