refactored metrics

This commit is contained in:
Danny Coates 2017-08-05 12:23:58 -07:00
parent 2a7099a7a2
commit b0d36529a1
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
8 changed files with 330 additions and 258 deletions

View file

@ -143,12 +143,12 @@ app.get('/download/:id', async (req, res) => {
try {
const filename = await storage.filename(id);
const contentLength = await storage.length(id);
const timeToExpiry = await storage.ttl(id);
const ttl = await storage.ttl(id);
res.render('download', {
filename: decodeURIComponent(filename),
filesize: bytes(contentLength),
sizeInBytes: contentLength,
timeToExpiry: timeToExpiry
ttl
});
} catch (e) {
res.status(404).render('notfound');