зеркало из https://github.com/mozilla/hubs.git
Use ENV var for dev server
This commit is contained in:
Родитель
ce3c1c8642
Коммит
145a46dec0
|
@ -3,3 +3,4 @@
|
|||
ORIGIN_TRIAL_TOKEN="ArEZ0vY0uMo3pj+oY8Up4u4Hy8QolJwKxG4/2WRhSPnTZRrviiGhzP6/y72nBdsIhdEyoundxqg//KLbs2vGnQoAAABkeyJvcmlnaW4iOiJodHRwczovL3JldGljdWx1bS5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViVlIxLjFNNjIiLCJleHBpcnkiOjE1MjYzNDg2MjEsImlzU3ViZG9tYWluIjp0cnVlfQ=="
|
||||
ORIGIN_TRIAL_EXPIRES="2018-05-15"
|
||||
JANUS_SERVER="wss://prod-janus.reticulum.io"
|
||||
DEV_RETICULUM_SERVER="dev.reticulum.io"
|
||||
|
|
|
@ -304,7 +304,8 @@ const onReady = async () => {
|
|||
const socketProtocol = document.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
const socketPort = qs.phx_port || (process.env.NODE_ENV === "production" ? document.location.port : 443);
|
||||
const socketHost =
|
||||
qs.phx_host || (process.env.NODE_ENV === "production" ? document.location.hostname : "dev.reticulum.io");
|
||||
qs.phx_host ||
|
||||
(process.env.NODE_ENV === "production" ? document.location.hostname : process.env.DEV_RETICULUM_SERVER);
|
||||
const socketUrl = `${socketProtocol}//${socketHost}${socketPort ? `:${socketPort}` : ""}/socket`;
|
||||
console.log(`Phoenix Channel URL: ${socketUrl}`);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class HubCreatePanel extends Component {
|
|||
let createUrl = "/api/v1/hubs";
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
createUrl = `https://dev.reticulum.io${createUrl}`;
|
||||
createUrl = `https://${process.env.DEV_RETICULUM_SERVER}${createUrl}`;
|
||||
}
|
||||
|
||||
const res = await fetch(createUrl, {
|
||||
|
|
|
@ -216,7 +216,8 @@ const config = {
|
|||
new webpack.DefinePlugin({
|
||||
"process.env": JSON.stringify({
|
||||
NODE_ENV: process.env.NODE_ENV,
|
||||
JANUS_SERVER: process.env.JANUS_SERVER
|
||||
JANUS_SERVER: process.env.JANUS_SERVER,
|
||||
DEV_RETICULUM_SERVER: process.env.DEV_RETICULUM_SERVER
|
||||
})
|
||||
})
|
||||
]
|
||||
|
|
Загрузка…
Ссылка в новой задаче