diff --git a/src/hub.js b/src/hub.js index 382d4b56c04de413a64c78aba13d5d33848f420a..3cf536666ff0b7776dfcef7f6c3a5ce097fd5041 100644 --- a/src/hub.js +++ b/src/hub.js @@ -329,8 +329,9 @@ const onReady = async () => { console.log(`Hub ID: ${hubId}`); const socketProtocol = document.location.protocol === "https:" ? "wss:" : "ws:"; - const socketPort = qs.phx_port || document.location.port; - const socketHost = qs.phx_host || document.location.hostname; + 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"); const socketUrl = `${socketProtocol}//${socketHost}${socketPort ? `:${socketPort}` : ""}/socket`; console.log(`Phoenix Channel URL: ${socketUrl}`); diff --git a/src/react-components/home-root.js b/src/react-components/home-root.js index d91dfdbed6e726a785cbb8744d35e3dab066085c..231d8b747cbfda01c463310f716ca78d0438f53c 100644 --- a/src/react-components/home-root.js +++ b/src/react-components/home-root.js @@ -19,9 +19,9 @@ const messages = localeData[lang] || localeData.en; const ENVIRONMENT_URLS = [ "https://asset-bundles-prod.reticulum.io/rooms/meetingroom/MeetingRoom.bundle.json", - "https://asset-bundles-prod.reticulum.io/rooms/theater/TheaterMeshes.bundle.json", - "https://asset-bundles-prod.reticulum.io/rooms/atrium/AtriumMeshes.bundle.json", - "https://asset-bundles-prod.reticulum.io/rooms/courtyard/CourtyardMeshes.bundle.json" + "https://asset-bundles-prod.reticulum.io/rooms/theater/Theater.bundle.json", + "https://asset-bundles-prod.reticulum.io/rooms/atrium/Atrium.bundle.json", + "https://asset-bundles-prod.reticulum.io/rooms/courtyard/Courtyard.bundle.json" ]; class HomeRoot extends Component { diff --git a/src/react-components/hub-create-panel.js b/src/react-components/hub-create-panel.js index 32fd19b4edfcb343b0cada0d4f0abf0052344d8e..4884bee6518d4234ea9addb55717cd24273bab50 100644 --- a/src/react-components/hub-create-panel.js +++ b/src/react-components/hub-create-panel.js @@ -38,14 +38,25 @@ class HubCreatePanel extends Component { hub: { name: this.state.name, default_environment_gltf_bundle_url: environment.bundle_url } }; - const res = await fetch("/api/v1/hubs", { + let createUrl = "/api/v1/hubs"; + + if (process.env.NODE_ENV === "development") { + createUrl = `https://dev.reticulum.io${createUrl}`; + } + + const res = await fetch(createUrl, { body: JSON.stringify(payload), headers: { "content-type": "application/json" }, method: "POST" }); const hub = await res.json(); - document.location = hub.url; + + if (process.env.NODE_ENV === "production") { + document.location = hub.url; + } else { + document.location = `/hub.html?hub_id=${hub.hub_id}`; + } }; isHubNameValid = () => { diff --git a/src/telemetry.js b/src/telemetry.js index 6eed4d002b96c507dcdaea78b6a5ab58f9791441..9fa4ae9ce79009d203fb4992cd6d643460633794 100644 --- a/src/telemetry.js +++ b/src/telemetry.js @@ -2,6 +2,6 @@ import Raven from "raven-js"; export default function registerTelemetry() { if (process.env.NODE_ENV === "production") { - Raven.config("https://f571beaf5cee4e3085e0bf436f3eb158@sentry.io/256771").install(); + Raven.config("https://013d6a364fed43cdb0539a61d520597a@sentry.prod.mozaws.net/370").install(); } } diff --git a/webpack.config.js b/webpack.config.js index ad98143b501e72b300362f7086a452485e92adec..506088726edc151d0dfc10370a3d540991a187e5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -87,7 +87,7 @@ const config = { mode: "development", devtool: process.env.NODE_ENV === "production" ? "source-map" : "inline-source-map", devServer: { - open: true, + open: false, https: createHTTPSConfig(), host: "0.0.0.0", useLocalIp: true,