Skip to content

Commit

Permalink
updating db conn
Browse files Browse the repository at this point in the history
  • Loading branch information
nourkrimesh committed Aug 10, 2023
1 parent 83d77dd commit 194e992
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/db/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 6,12 @@ import mongoose, { ConnectOptions } from 'mongoose';
const connectToDatabase = async () => {
let mongoURI;

if (config.environment === 'development') {
mongoURI = config.mongo.devDB.url;
} else if (config.environment === 'test') {
if (config.environment === 'test') {
mongoURI = config.mongo.testDB.url;
}
else {
mongoURI = config.mongo.devDB.url;
}
console.log('1: trying to connect to database with connStr:', mongoURI);
if (mongoURI !== undefined) {
try {
Expand Down

0 comments on commit 194e992

Please sign in to comment.