From d9ae52c88a04fd76282282fba66ffec9f65974de Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Thu, 22 Jun 2023 19:53:40 +0000 Subject: [PATCH] support indev remotes --- packages/comty.js/src/remotes.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/comty.js/src/remotes.js b/packages/comty.js/src/remotes.js index 486f3f91..9f431256 100644 --- a/packages/comty.js/src/remotes.js +++ b/packages/comty.js/src/remotes.js @@ -1,4 +1,10 @@ function composeRemote(path) { + if (typeof window !== "undefined") { + if (window.localStorage.getItem("comty:use_indev") || window.location.hostname === "indev.comty.app") { + return envOrigins["indev"][path] + } + } + return envOrigins[process.env.NODE_ENV ?? "production"][path] } @@ -19,6 +25,14 @@ const envOrigins = { music: `http://${getCurrentHostname()}:3050`, files: `http://${getCurrentHostname()}:3060`, }, + "indev": { + default: `https://indev_api.comty.app/default`, + chat: `https://indev_api.comty.app/chat`, + livestreaming: `https://indev_api.comty.app/livestreaming`, + marketplace: `https://indev_api.comty.app/marketplace`, + music: `https://indev_api.comty.app/music`, + files: `https://indev_api.comty.app/files`, + }, "production": { default: "https://api.comty.app", chat: `https://chat_api.comty.app`,