Switch to Koa, more es6
This commit is contained in:
parent
1090affc9c
commit
b3abff99ae
36 changed files with 25573 additions and 928 deletions
17
config/db.js
Normal file
17
config/db.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
'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;
|
||||
|
||||
const uristring = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://localhost:27017/match-audio';
|
||||
|
||||
module.exports = function*() {
|
||||
const client = yield MongoClient.connect(uristring);
|
||||
debug('Successfully connected to Mongodb');
|
||||
client.matches = client.collection('matches');
|
||||
return client;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue