mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-18 07:35:19 +00:00
Merge pull request #358 from storytold/brandon-fix-hostname-environment-config
Fix hostname-based environment config
This commit is contained in:
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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user