Instantly share code, notes, and snippets.

Embed
What would you like to do?
database
const mongoose = require('mongoose');
const initDB = () => {
mongoose.connect(
'mongodb://indrek:graphql1@ds213615.mlab.com:13615/koa-graphql',
{ useNewUrlParser: true }
);
mongoose.connection.once('open', () => {
console.log('connected to database');
});
}
module.exports = initDB;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment