diff --git a/scripts/build_local_reticulum.sh b/scripts/build_local_reticulum.sh deleted file mode 100755 index 9a19f9f202b688b27213b0478f9e1a14e67d2620..0000000000000000000000000000000000000000 --- a/scripts/build_local_reticulum.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -if [ ! -e ../reticulum ]; then - echo "This script assumes reticulum is checked out in a sibling to this folder." -fi - -rm -rf ../reticulum/priv/static ; GENERATE_SMOKE_TESTS=true BASE_ASSETS_PATH=https://hubs.local:4000/ yarn build -- --output-path ../reticulum/priv/static diff --git a/scripts/run-local-reticulum.sh b/scripts/run-local-reticulum.sh new file mode 100644 index 0000000000000000000000000000000000000000..976d858cd8dd7adea49ae587995759c431420182 --- /dev/null +++ b/scripts/run-local-reticulum.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +BASE_ASSETS_PATH=https://hubs.local:8080/ DEV_RETICULUM_SERVER=hubs.local:4000 yarn start diff --git a/src/react-components/hub-create-panel.js b/src/react-components/hub-create-panel.js index 7e44ce63093ad5ad3df772807794140cab9af2b9..dc10b99ac217609b07bda59422c805c5ea4f1581 100644 --- a/src/react-components/hub-create-panel.js +++ b/src/react-components/hub-create-panel.js @@ -85,7 +85,7 @@ class HubCreatePanel extends Component { const hub = await res.json(); - if (process.env.NODE_ENV === "production") { + if (process.env.NODE_ENV === "production" || document.location.host === process.env.DEV_RETICULUM_SERVER) { document.location = hub.url; } else { document.location = `/hub.html?hub_id=${hub.hub_id}`; diff --git a/webpack.config.js b/webpack.config.js index 163ddf37ffe155790bf97771510187b90f9ca2ca..5f688d9bfa687d8cc517eb0b98e9d70b74fd71d2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -99,6 +99,7 @@ const config = { useLocalIp: true, public: "hubs.local:8080", port: 8080, + headers: { "Access-Control-Allow-Origin": "*" }, before: function(app) { // networked-aframe makes HEAD requests to the server for time syncing. Respond with an empty body. app.head("*", function(req, res, next) {