0.1.3 • Published 5 years ago
connect-db v0.1.3
connectDB
Overview
A very fast way to connect with your mongoDB instance.
Example
in your index.js
throw this peace of code.
const DbConnectionService = require('connect-db');
dbConnectionService = new DbConnectionService({
uri: 'mongodb://localhost:27017/my-database-name',
onError: (err) => console.log('[CustomErrorHuddler]', err),
onConnected: () => console.log('[CustomConnectionHuddler] You are Connected. Continue...')}
)
dbConnectionService.connectDB()
.then(() => console.log('[TestApp] You Are Ready 2 Rock'))
.then(startServer)