Finally finished giant ES6 refactor
This commit is contained in:
parent
c6d48cc424
commit
03e2666958
39 changed files with 553 additions and 635 deletions
14
config/db.js
14
config/db.js
|
@ -1,15 +1,11 @@
|
|||
'use strict';
|
||||
const debug = require('debug')('match.audio');
|
||||
|
||||
// Shut mongodb-promisified up.
|
||||
const dir = console.dir;
|
||||
console.dir = function() {};
|
||||
const MongoClient = require('mongodb-promisified')().MongoClient;
|
||||
console.dir = dir;
|
||||
import mongodb from 'mongodb-promisified';
|
||||
const MongoClient = mongodb().MongoClient;
|
||||
import debuglog from 'debug';
|
||||
const debug = debuglog('match.audio');
|
||||
|
||||
const uristring = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://localhost:27017/match-audio';
|
||||
|
||||
module.exports = function*() {
|
||||
export default function*() {
|
||||
const client = yield MongoClient.connect(uristring);
|
||||
debug('Successfully connected to Mongodb');
|
||||
client.matches = client.collection('matches');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue