Merge pull request #358 from storytold/brandon-fix-hostname-environment-config

Fix hostname-based environment config
This commit is contained in:
Brandon Thomas authored and GitHub committed 2023-11-16 16:32:09 -05:00
commit 653c41c61b
2 files changed
+4 -9

No files matched your search

@@ -22,8 +22,6 @@ export default function GetApiHost() {
return hostConfig("api.fakeyou.com");
case "devproxy.storyteller.ai":
return hostConfig("api.storyteller.ai");
case "dev.fakeyou.com":
return hostConfig("api.dev.fakeyou.com"); // NB: for dev machines with nginx proxies
case "dev.fakeyou.com":
return hostConfig("api.dev.fakeyou.com:12345",false); // false disables SSL
default:
+4 -7
View File
@@ -10,19 +10,16 @@ export class FakeYouFrontendEnvironment {
environment: Environment;
private constructor() {
switch (document.location.host) {
const domainWithoutPort = document.location.host.split(":")[0];
switch (domainWithoutPort) {
case "fakeyou.com":
this.environment = Environment.Production;
break;
case "staging.fakeyou.com":
this.environment = Environment.Staging;
break;
case "localhost:7000":
this.environment = Environment.Development;
break;
case "localhost:7001":
this.environment = Environment.Development;
break;
case "localhost":
case "dev.fakeyou.com":
this.environment = Environment.Development;
break;