import mongoose from 'mongoose' export default async () => { try { await mongoose.connect(config.mongoUrl, { authSource: 'admin', user: config.mongoUser, pass: config.mongoPass }) console.log('DB connection established') } catch (e) { console.error('DB connection failed', e) } }