Better dev server integration

This commit is contained in:
MICHAEL JACKSON
2018-02-16 16:00:06 -08:00
parent a22e0fa801
commit d6f2bc089a
42 changed files with 1753 additions and 1154 deletions

View File

@ -1,4 +1,4 @@
const BlacklistAPI = require("../BlacklistAPI")
const BlacklistAPI = require("../BlacklistAPI");
function checkBlacklist(req, res, next) {
BlacklistAPI.includesPackage(req.packageName).then(
@ -8,19 +8,19 @@ function checkBlacklist(req, res, next) {
res
.status(403)
.type("text")
.send(`Package "${req.packageName}" is blacklisted`)
.send(`Package "${req.packageName}" is blacklisted`);
} else {
next()
next();
}
},
error => {
console.error(error)
console.error(error);
res.status(500).send({
error: "Unable to fetch the blacklist"
})
});
}
)
);
}
module.exports = checkBlacklist
module.exports = checkBlacklist;