jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
692 B

'use strict';
const Mongo = require(__dirname+'/../helpers/db.js')
, db = Mongo.client.db('boards');
module.exports = {
db,
findOne: async (name) => {
return db.collection('boards').findOne({ '_id': name });
},
insertOne: async (data) => {
return db.collection('boards').insertOne(data);
},
deleteOne: async (board, options) => {
},
deleteMany: async (board, options) => {
},
deleteAll: async (board) => {
return db.collection('boards').deleteMany({});
},
exists: async (req, res, next) => {
const board = await module.exports.findOne(req.params.board)
if (!board) {
return res.status(404).render('404')
}
res.locals.board = board;
next();
},
}