1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-10 13:13:00 +01:00
send/server/routes/info.js

15 lines
290 B
JavaScript
Raw Normal View History

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);
}
};