db.js 258 Bytes
const config = require('./config');
const db = require('monk')(config.db);

module.exports = db;

db.then(async() => {
    await db.get('board').createIndex({name: 1}, {unique: true});
    await db.get('thread').createIndex({board: 1, lastUpdated: -1});
});