info.js 290 B

1234567891011121314
  1. const storage = require('../storage');
  2. module.exports = async function(req, res) {
  3. try {
  4. const ttl = await storage.ttl(req.params.id);
  5. return res.send({
  6. dlimit: +req.meta.dlimit,
  7. dtotal: +req.meta.dl,
  8. ttl
  9. });
  10. } catch (e) {
  11. res.sendStatus(404);
  12. }
  13. };