1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-14 07:02:30 +01:00
send/server/routes/info.js
2018-02-09 15:03:05 -08:00

15 lines
290 B
JavaScript

const storage = require('../storage');
module.exports = async function(req, res) {
try {
const ttl = await storage.ttl(req.params.id);
return res.send({
dlimit: +req.meta.dlimit,
dtotal: +req.meta.dl,
ttl
});
} catch (e) {
res.sendStatus(404);
}
};