refactored server

This commit is contained in:
Danny Coates
2018-02-06 14:31:18 -08:00
parent 6d470b8eba
commit 3fd2537311
36 changed files with 2944 additions and 792 deletions

View File

@@ -1,13 +1,11 @@
const storage = require('../storage');
module.exports = async (req, res) => {
const id = req.params.id;
try {
const meta = await storage.metadata(id);
const meta = await storage.metadata(req.params.id);
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
res.send({
password: meta.pwd !== '0'
password: meta.pwd
});
} catch (e) {
res.sendStatus(404);