Skip to content

Instantly share code, notes, and snippets.

@seniv
Created May 8, 2018 13:02
Show Gist options
  • Save seniv/10753d3adc5d1a9677c72eada2a46454 to your computer and use it in GitHub Desktop.
Save seniv/10753d3adc5d1a9677c72eada2a46454 to your computer and use it in GitHub Desktop.
const mongoose = require('mongoose');
class MongoManager {
constructor (config) {
this._config = config;
}
getMongoUrl() {
return this._config.MONGODB_URI;
}
connect () {
return mongoose.connect(this.getMongoUrl());
}
}
module.exports = MongoManager;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment