mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14:16 +00:00
added multiple envOrigins
depending on env
This commit is contained in:
parent
8c67d78d45
commit
bd8285762a
@ -3,6 +3,26 @@ import defaultTheme from "../constants/defaultTheme.json"
|
|||||||
import defaultSoundPack from "../constants/defaultSoundPack.json"
|
import defaultSoundPack from "../constants/defaultSoundPack.json"
|
||||||
import defaultRemotesOrigins from "../constants/defaultRemotesOrigins.json"
|
import defaultRemotesOrigins from "../constants/defaultRemotesOrigins.json"
|
||||||
|
|
||||||
|
const envOrigins = {
|
||||||
|
"development": {
|
||||||
|
mainApi: `http://${window.location.hostname}:3000`,
|
||||||
|
websocketApi: `ws://${window.location.hostname}:3001`,
|
||||||
|
streamingApi: `http://${window.location.hostname}:3002`,
|
||||||
|
},
|
||||||
|
"indev": {
|
||||||
|
mainApi: "https://indev_api.comty.pw",
|
||||||
|
websocketApi: "wss://indev_ws.comty.pw",
|
||||||
|
streamingApi: "https://indev_live.comty.pw",
|
||||||
|
},
|
||||||
|
"nightly": {
|
||||||
|
mainApi: "https://nightly_api.comty.pw",
|
||||||
|
websocketApi: "wss://nightly_ws.comty.pw",
|
||||||
|
streamingApi: "https://nightly_live.comty.pw"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Config loaded with mode: [${process.env.NODE_ENV}]`)
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
package: packagejson,
|
package: packagejson,
|
||||||
defaultTheme: defaultTheme,
|
defaultTheme: defaultTheme,
|
||||||
@ -13,9 +33,9 @@ export default {
|
|||||||
full: "/logo_full.svg",
|
full: "/logo_full.svg",
|
||||||
},
|
},
|
||||||
remotes: {
|
remotes: {
|
||||||
mainApi: process.env.NODE_ENV !== "production" ? `http://${window.location.hostname}:3000` : defaultRemotesOrigins.main_api,
|
mainApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].mainApi : defaultRemotesOrigins.main_api,
|
||||||
websocketApi: process.env.NODE_ENV !== "production" ? `ws://${window.location.hostname}:3001` : defaultRemotesOrigins.websocket_api,
|
websocketApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].websocketApi : defaultRemotesOrigins.websocket_api,
|
||||||
streamingApi: process.env.NODE_ENV !== "production" ? `http://${window.location.hostname}:3002` : defaultRemotesOrigins.streaming_api,
|
streamingApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].streamingApi : defaultRemotesOrigins.streaming_api,
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
title: packagejson.name,
|
title: packagejson.name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user