Skip to content

Commit 38361fd

Browse files
committed
Allow to run real time dashboard locally
1 parent 47b256d commit 38361fd

File tree

4 files changed

+1011
-300
lines changed

4 files changed

+1011
-300
lines changed

Diff for: examples/real-time-dashboard/dashboard-app/src/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import tracker from "./tracker";
99
const CUBEJS_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NzM2MjI5MjR9.iD_sSpXRBQSO0ywh5zSPHpHV-1O37oQMakrkG03kR-o";
1010
let WS_URL;
1111
if (process.env.NODE_ENV === 'production') {
12-
WS_URL = "wss://real-time-dashboard-demo.cube.dev/"
12+
WS_URL = window.location.origin.replace('http', 'ws').replace('https', 'wss')
1313
} else {
1414
WS_URL = "ws://localhost:4000/"
1515
}

Diff for: examples/real-time-dashboard/dashboard-app/src/tracker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { fetch } from "whatwg-fetch";
44

55
let URL;
66
if (process.env.NODE_ENV === 'production') {
7-
URL = "https://real-time-dashboard-demo.cube.dev"
7+
URL = window.location.origin
88
} else {
99
URL = "http://localhost:4000"
1010
}

Diff for: examples/real-time-dashboard/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"start": "node index.js"
99
},
1010
"dependencies": {
11-
"@cubejs-backend/mongobi-driver": "^0.11.6",
12-
"@cubejs-backend/server": "^0.11.16",
11+
"@cubejs-backend/mongobi-driver": "^0.13.0",
12+
"@cubejs-backend/server": "^0.13.1",
1313
"moment": "^2.24.0",
1414
"mongodb": "^3.3.3",
1515
"serve-static": "^1.14.1"

0 commit comments

Comments
 (0)