Created
February 13, 2017 16:35
-
-
Save TaylorAckley/ca11d1bf30d7a3c012588737de8f0f8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const appConfig = require('../config.js'); | |
const mongoose = require('mongoose'); | |
mongoose.connect(appConfig.MONGOLAB_URI); | |
mongoose.connection.on('error', (err) => { | |
console.log('Error: Could not connect to MongoDB. Did you forget to run `mongod`?'); | |
}); | |
mongoose.connection.once('open', (err) => { | |
console.log('Connected to MongoDb'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment