URLs
- Copyright:
- 2015–2020 RewardOps Inc.
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 |
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 |
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:
- the
apiServerUrl
setting frommodule:config~DefaultConfig
; or, - a
REWARDOPS_ENV
Node environment variable (case-insensitive; seemodule:urls~ENVIRONMENT_URLS
).
If neither has a known value, the production server URL is returned.
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