Skip to content

Commit 63c6bc6

Browse files
committed
fix node
1 parent 9d7a4dc commit 63c6bc6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

node/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const jwt = require("jsonwebtoken");
66
const PORT = process.env["PORT"] ? parseInt(process.env["PORT"]) : 3001;
77

88
// these should match the settings in your Metabase instance
9-
let MB_SITE_URL = "localhost:3000";
9+
let MB_SITE_URL = "http://localhost:3000";
1010
let MB_EMBEDDING_SECRET_KEY = "a1c0952f3ff361f1e7dd8433a0a50689a004317a198ecb0a67ba90c73c27a958";
1111

1212
let payload = {
@@ -68,14 +68,14 @@ app.get("/logout", (req, res) => {
6868
app.get("/signed_chart/:id", checkAuth, (req, res) => {
6969
const userId = req.session.userId;
7070
const unsignedToken = {
71-
resource: { dashboard: DASHBOARD_ID },
71+
resource: { question: 2 },
7272
params: { person_id: userId }
7373
};
7474

7575
// sign the JWT token with our secret key
7676
const signedToken = jwt.sign(unsignedToken, MB_EMBEDDING_SECRET_KEY);
7777
// construct the URL of the iframe to be displayed
78-
const iframeUrl = `${MB_SITE_URL}/embed/dashboard/${signedToken}`;
78+
const iframeUrl = `${MB_SITE_URL}/embed/question/${signedToken}`;
7979
res.render("chart", { userId: req.params.id, iframeUrl: iframeUrl });
8080
})
8181

node/views/chart.pug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ block content
2626

2727
pre.
2828
<iframe
29-
src="http://#{iframeUrl}"
29+
src="#{iframeUrl}"
3030
frameborder="0"
3131
width="800"
3232
height="600"
@@ -40,7 +40,7 @@ block content
4040
h1 Orders for User: #{userId}</h1>
4141

4242
iframe(
43-
src="http://#{iframeUrl}"
43+
src=iframeUrl
4444
frameborder="0"
4545
width="800"
4646
height="600"

node/views/dashboard.pug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ block content
3232

3333
pre.
3434
&lt;iframe
35-
src="http://{iframeUrl}"
35+
src="{iframeUrl}"
3636
frameborder="0"
3737
width="800"
3838
height="600"
@@ -45,7 +45,7 @@ block content
4545

4646
h2 Stats for User: #{userId}
4747

48-
iframe(src="http://{{iframeUrl}}"
48+
iframe(src=iframeUrl
4949
width="1200"
5050
height="800"
5151
frameborder="0")

0 commit comments

Comments
 (0)