drop.chapril.org-firefoxsend/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);
}
};