support indev remotes

This commit is contained in:
SrGooglo 2023-06-22 19:53:40 +00:00
parent 4634691b31
commit d9ae52c88a

View File

@ -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`,