X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Fdlux-web%2Fsrc%2Fcommon%2Fconfig%2Fenv.module.js;fp=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Fdlux-web%2Fsrc%2Fcommon%2Fconfig%2Fenv.module.js;h=633ad138360b823c3229cae91b294c9a04492d4e;hb=27fb2d06608fbb070ae2c15a5580a4f5b2423d15;hp=0000000000000000000000000000000000000000;hpb=60315525ab5e7c12a9f47c409092e8dba6ad656d;p=ccsdk%2Fapps.git diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/config/env.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/config/env.module.js new file mode 100644 index 00000000..633ad138 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/config/env.module.js @@ -0,0 +1,37 @@ +define(['angular'], function (angular) { + 'use strict'; + + var config = angular.module('config', []) + .constant('ENV', { + + baseURL: '', + adSalPort: '8080', + mdSalPort: '8181', + mdSalSecuredPort: '8443', + configEnv: 'ENV_PROD', + getBaseURL: function (salType) { + if (salType !== undefined) { + var urlPrefix = ''; + if (this.configEnv === 'ENV_DEV') { + urlPrefix = this.baseURL; + } else { + urlPrefix = window.location.protocol + '//' + window.location.hostname + ':'; + } + + if (salType === 'AD_SAL') { + return urlPrefix + this.adSalPort; + } else if (salType === 'MD_SAL') { + var basePort = this.mdSalPort; + if (window.location.protocol === 'https:') { + basePort = this.mdSalSecuredPort; + } + return urlPrefix + basePort; + } + } + //default behavior + return ''; + } + }); + + return config; +});