2018-01-30 21:15:09 +01:00
|
|
|
const storage = require('../storage');
|
|
|
|
|
|
|
|
module.exports = async function(req, res) {
|
|
|
|
try {
|
2018-02-06 23:31:18 +01:00
|
|
|
const ttl = await storage.ttl(req.params.id);
|
2018-01-30 21:15:09 +01:00
|
|
|
return res.send({
|
2018-02-06 23:31:18 +01:00
|
|
|
dlimit: +req.meta.dlimit,
|
|
|
|
dtotal: +req.meta.dl,
|
2018-01-30 21:15:09 +01:00
|
|
|
ttl
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
res.sendStatus(404);
|
|
|
|
}
|
|
|
|
};
|