finished metrics

This commit is contained in:
Abhinav Adduri 2017-07-20 15:16:00 -07:00
parent 76a6f02eb7
commit 99477774cf
9 changed files with 542 additions and 173 deletions

View file

@ -107,12 +107,18 @@ app.get('/download/:id', (req, res) => {
storage
.length(id)
.then(contentLength => {
res.render('download', {
filename: decodeURIComponent(filename),
filesize: bytes(contentLength),
trackerId: conf.analytics_id,
dsn: conf.sentry_id
});
storage
.ttl(id)
.then(timeToExpiry => {
res.render('download', {
filename: decodeURIComponent(filename),
filesize: bytes(contentLength),
sizeInBytes: contentLength,
timeToExpiry: timeToExpiry,
trackerId: conf.analytics_id,
dsn: conf.sentry_id
});
})
})
.catch(() => {
res.render('download');