22.08.07 20:14 작성
·
403
0
module.exports = { mongoURI:'mongodb+srv://아이디:비밀번호@simpleboardcluster.talxb.mongodb.net/test' }
if(process.env.NODE_ENV === 'production') {
module.exports = require('./prod');
} else {
module.exports = require('./dev');
}
module.exports = {
mongoURI: process.env.MONGO_URI
}
const mongoose = require('mongoose')
mongoose.connect('config.mongoURI', {
useNewUrlParser: true,
useUnifiedTopology: true
// useCreateIndex: true,
// useFindAndModify: false
}).then(() => console.log('mongoDB Connected...')).catch(err => console.log(err))