fox-send/server/routes/info.js

15 lines
290 B
JavaScript
Raw Permalink Normal View History

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