Skip to content

Commit bfecee8

Browse files
Merge pull request #1 from metabase/update-code
Updates to sample code
2 parents ac72fc7 + 119a2a2 commit bfecee8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ app.get('/', function(req, res){
114114
});
115115

116116
app.get('/analytics', restrict, function(req, res){
117-
var iframeUrl = '/sso/metabase?return_to=/dashboard/2-a-look-at-your-invoices-table';
117+
// replace ID "1" with the ID number in the path of your dashboard in Metabase.
118+
const METABASE_DASHBOARD_PATH = "/dashboard/1"
119+
var iframeUrl = `/sso/metabase?return_to=${METABASE_DASHBOARD_PATH}`;
118120
res.send(`<iframe src="${iframeUrl}" frameborder="0" width="1280" height="600" allowtransparency></iframe>`);
119121
});
120122

@@ -169,8 +171,8 @@ app.get("/sso/metabase", restrict, (req, res) => {
169171
);
170172
});
171173

172-
/* istanbul ignore next */
174+
const PORT = 8080;
173175
if (!module.parent) {
174-
app.listen(3000);
175-
console.log('Express started on port 3000');
176+
app.listen(PORT);
177+
console.log(`Express started serving on port ${PORT}`);
176178
}

0 commit comments

Comments
 (0)