Merge branch 'master' into ui
This commit is contained in:
commit
be3df22757
9 changed files with 55 additions and 6 deletions
|
@ -16,7 +16,10 @@ const log = mozlog('portal.server');
|
|||
|
||||
const app = express();
|
||||
|
||||
app.engine('handlebars', exphbs({ defaultLayout: 'main' }));
|
||||
app.engine('handlebars', exphbs({
|
||||
defaultLayout: 'main',
|
||||
partialsDir: 'views/partials/'
|
||||
}));
|
||||
app.set('view engine', 'handlebars');
|
||||
|
||||
app.use(helmet());
|
||||
|
@ -25,7 +28,10 @@ app.use(bodyParser.json());
|
|||
app.use(express.static(path.join(__dirname, '../public')));
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.render('index');
|
||||
res.render('index', {
|
||||
shouldRenderAnalytics: notLocalHost,
|
||||
trackerId: conf.analytics_id
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/exists/:id', (req, res) => {
|
||||
|
@ -43,7 +49,9 @@ app.get('/download/:id', (req, res) => {
|
|||
.then(contentLength => {
|
||||
res.render('download', {
|
||||
filename: filename,
|
||||
filesize: bytes(contentLength)
|
||||
filesize: bytes(contentLength),
|
||||
shouldRenderAnalytics: notLocalHost,
|
||||
trackerId: conf.analytics_id
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue