smarter db connection

tests
This commit is contained in:
2018-05-20 23:35:21 +03:00
parent a9b318cb4d
commit 76b6f76758
6 changed files with 1954 additions and 2792 deletions

View File

@@ -4,4 +4,15 @@ const config = require('./');
const { host, port, name } = config.db;
const connectionString = `mongodb://${host}:${port}/${name}`;
mongoose.connect(connectionString);
async function connect() {
await mongoose.connect(connectionString);
}
async function disconnect() {
await mongoose.disconnect();
}
module.exports = {
connect,
disconnect,
};