Compare commits

..

No commits in common. "186ae122637606b5c1bd1d23172c9125b6a61971" and "97296c8d1c8603aff654c1f1c5d24b840ee58015" have entirely different histories.

3 changed files with 14 additions and 4 deletions

View File

@ -9,4 +9,6 @@ EXPOSE 3000
WORKDIR /data
RUN "npm i"
CMD ["node", "index.js"]

View File

@ -14,9 +14,14 @@ app.use(bodyParser.json(),function (req, res, next) {
})
app.get('/meta/blacklist', function (req, res) {
list.getAllBlack().then(r => {
res.send(JSON.stringify(r))
})
})
app.get('/status/:status', function (req, res) {
list.getStatus(req.params.status).then(r => {
app.get('/meta/greylist', function (req, res) {
list.getAllGrey().then(r => {
res.send(JSON.stringify(r))
})
})

View File

@ -44,8 +44,11 @@ async function verifyMsg (obj, username) {
list = {
getStatus: async () => {
return await mongo.get("list","list",{"status": status})
getAllBlack: async () => {
return await mongo.get("list","list",{"status": "black"})
},
getAllGrey: async () => {
return await mongo.get("list","list",{"status": "black"})
},
getUser: async (username) => {
return await mongo.get("list","list",{"user": username})