2021-11-25 22:02:18 -05:00
|
|
|
require('dotenv').config({ path: 'development.env' }); // Grabs MONGODB URI
|
2021-11-25 15:25:29 -05:00
|
|
|
|
2021-11-25 22:02:18 -05:00
|
|
|
const mongoose = require('mongoose'); //import mongoose
|
2021-11-25 15:25:29 -05:00
|
|
|
|
2021-11-25 22:02:18 -05:00
|
|
|
//Connects to the mongo databse attached to heroku app
|
2021-11-25 15:25:29 -05:00
|
|
|
mongoose.connect(
|
|
|
|
|
process.env.MONGODB_URI,
|
|
|
|
|
(err) => {
|
|
|
|
|
if (err) return console.log("Error: ", err);
|
|
|
|
|
console.log("MongoDB Connection -- Ready state is:", mongoose.connection.readyState);
|
|
|
|
|
}
|
|
|
|
|
);
|