diff --git a/src/app/services/env.service.ts b/src/app/services/env.service.ts index c275410..7359180 100644 --- a/src/app/services/env.service.ts +++ b/src/app/services/env.service.ts @@ -16,9 +16,11 @@ export class EnvService { private getHazmapperUrl(backend: EnvironmentType): string { if (backend === EnvironmentType.Local) { - return 'https://hazmapper.tacc.utexas.edu/hazmapper'; + return 'http://localhost:4200/'; } else if (backend === EnvironmentType.Staging) { return 'https://hazmapper.tacc.utexas.edu/staging'; + } else if (backend === EnvironmentType.Dev) { + return 'https://hazmapper.tacc.utexas.edu/dev'; } else if (backend === EnvironmentType.Production) { return 'https://hazmapper.tacc.utexas.edu/hazmapper'; } else { @@ -33,6 +35,8 @@ export class EnvService { return 'https://agave.designsafe-ci.org/geo-staging/v2'; } else if (backend === EnvironmentType.Production) { return 'https://agave.designsafe-ci.org/geo/v2'; + } else if (backend === EnvironmentType.Dev) { + return 'https://agave.designsafe-ci.org/geo-dev/v2'; } else { throw new Error('Unsupported Type'); } @@ -106,6 +110,13 @@ export class EnvService { } this._baseHref = '/'; this._clientId = 'RMCJHgW9CwJ6mKjhLTDnUYBo9Hka'; + } else if (/^hazmapper.tacc.utexas.edu/.test(hostname) && pathname.startsWith('/taggit-dev')) { + this._env = EnvironmentType.Dev; + this._apiUrl = this.getApiUrl(this.env); + this._portalUrl = this.getPortalUrl(this.env); + this._hazmapperUrl = this.getHazmapperUrl(this.env); + this._clientId = '2rSCfaGy7TIg2jLLZCfI0vhLREoa'; + this._baseHref = '/taggit-dev/'; } else if (/^hazmapper.tacc.utexas.edu/.test(hostname) && pathname.startsWith('/taggit-staging')) { this._env = EnvironmentType.Staging; this._apiUrl = this.getApiUrl(this.env); diff --git a/src/environments/environmentType.ts b/src/environments/environmentType.ts index 8966af1..4a06213 100644 --- a/src/environments/environmentType.ts +++ b/src/environments/environmentType.ts @@ -1,5 +1,6 @@ export enum EnvironmentType { Production = 'production', Staging = 'staging', + Dev = 'dev', Local = 'local', } diff --git a/src/index.html b/src/index.html index 161d5f2..ce87bdd 100644 --- a/src/index.html +++ b/src/index.html @@ -29,7 +29,9 @@ var hostname = window.location.hostname; var pathname = window.location.pathname; - if (/^hazmapper.tacc.utexas.edu/.test(hostname) && pathname.startsWith('/taggit-staging')) { + if (/^hazmapper.tacc.utexas.edu/.test(hostname) && pathname.startsWith('/taggit-dev')) { + document.getElementById('base').href = '/taggit-dev/'; + } else if (/^hazmapper.tacc.utexas.edu/.test(hostname) && pathname.startsWith('/taggit-staging')) { document.getElementById('base').href = '/taggit-staging/'; } else if (/^hazmapper.tacc.utexas.edu/.test(hostname)) { document.getElementById('base').href = '/taggit/';