Adding
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import devEnvironment from "../../environments/environment.dev";
|
||||
import prodEnvironment from "../../environments/environment.prod";
|
||||
import uatEnvironment from "../../environments/environment.uat";
|
||||
|
||||
const getConfigurationFromWindowLocation = () => {
|
||||
const hostname = window.location.hostname;
|
||||
if (hostname.match('localhost') || hostname.match('qa')) {
|
||||
return devEnvironment;
|
||||
}
|
||||
if (hostname.match('uat')) {
|
||||
return uatEnvironment;
|
||||
}
|
||||
return prodEnvironment;
|
||||
}
|
||||
|
||||
const config = getConfigurationFromWindowLocation();
|
||||
|
||||
/**
|
||||
* Static class for access application specific configuration data.
|
||||
*/
|
||||
export default class Configuration {
|
||||
|
||||
static get Get() {
|
||||
return config;
|
||||
}
|
||||
|
||||
static PrefixSSRSApiURL(relativeUrl: string){
|
||||
return config.baseUrls.SSRSReportBaseUrl + relativeUrl;
|
||||
}
|
||||
|
||||
static PrefixRepoApiUrl(relativeUrl: string) {
|
||||
return config.baseUrls.repoApi + relativeUrl;
|
||||
}
|
||||
|
||||
static PrefixCoreUrl(relativeUrl: string) {
|
||||
return config.baseUrls.core + relativeUrl;
|
||||
}
|
||||
|
||||
static PrefixCollectionsUrl(relativeUrl: string) {
|
||||
return config.baseUrls.collections + relativeUrl;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user