db.js

mail@pastecode.io avatar
unknown
javascript
3 years ago
379 B
10
Indexable
Never
// getting-started.js
const mongoose = require('mongoose');

const  conexion = async ()=> {
  const conn = await mongoose.connect(process.env.URI, {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useFindAndModify: false,
    useCreateIndex: true
  }); 
  
  console.log(`Base de Datos conectada ${conn.connection.host}`);
}

module.exports = conexion;