mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
added multiple envOrigins
depending on env
This commit is contained in:
parent
8abbdf2034
commit
cf1d6fdfc4
@ -3,6 +3,26 @@ import defaultTheme from "../constants/defaultTheme.json"
|
||||
import defaultSoundPack from "../constants/defaultSoundPack.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 {
|
||||
package: packagejson,
|
||||
defaultTheme: defaultTheme,
|
||||
@ -13,9 +33,9 @@ export default {
|
||||
full: "/logo_full.svg",
|
||||
},
|
||||
remotes: {
|
||||
mainApi: process.env.NODE_ENV !== "production" ? `http://${window.location.hostname}:3000` : defaultRemotesOrigins.main_api,
|
||||
websocketApi: process.env.NODE_ENV !== "production" ? `ws://${window.location.hostname}:3001` : defaultRemotesOrigins.websocket_api,
|
||||
streamingApi: process.env.NODE_ENV !== "production" ? `http://${window.location.hostname}:3002` : defaultRemotesOrigins.streaming_api,
|
||||
mainApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].mainApi : defaultRemotesOrigins.main_api,
|
||||
websocketApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].websocketApi : defaultRemotesOrigins.websocket_api,
|
||||
streamingApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].streamingApi : defaultRemotesOrigins.streaming_api,
|
||||
},
|
||||
app: {
|
||||
title: packagejson.name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user