Finally finished giant ES6 refactor

This commit is contained in:
Jonathan Cremin 2015-08-20 23:22:57 +01:00
parent c6d48cc424
commit 03e2666958
39 changed files with 553 additions and 635 deletions

View file

@ -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');