mirror of
https://gitlab.com/little-lines/backend.git
synced 2024-11-22 05:56:50 +00:00
13 lines
No EOL
361 B
JavaScript
13 lines
No EOL
361 B
JavaScript
const mongoose = require('mongoose');
|
|
|
|
const connectDb = async () => {
|
|
await mongoose.connect(process.env.CONNECTION_STRING, {
|
|
}).then(() => {
|
|
console.log("Database connected: ", mongoose.connection.host, mongoose.connection.name);
|
|
}).catch((err) => {
|
|
console.log(err);
|
|
process.exit(1);
|
|
});
|
|
}
|
|
|
|
module.exports = connectDb; |