diff --git a/server/server.js b/server/server.js index a0951e51..24e1d418 100644 --- a/server/server.js +++ b/server/server.js @@ -69,9 +69,15 @@ app.use('/l20n', express.static(L20N)); app.use('/locales', express.static(LOCALES)); app.get('/', (req, res) => { - res.render('index', { + res.render('index'); +}); + +app.get('/jsconfig.js', (req, res) => { + res.set('Content-Type', 'application/javascript'); + res.render('jsconfig', { trackerId: conf.analytics_id, - dsn: conf.sentry_id + dsn: conf.sentry_id, + layout: false }); }); diff --git a/views/jsconfig.handlebars b/views/jsconfig.handlebars new file mode 100644 index 00000000..1e960e83 --- /dev/null +++ b/views/jsconfig.handlebars @@ -0,0 +1,6 @@ +{{#if dsn}} +window.dsn = '{{{dsn}}}'; +{{/if}} +{{#if trackerId}} +window.trackerId = '{{{trackerId}}}'; +{{/if}} diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index d3a660ba..285ad3c7 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -2,15 +2,10 @@