Skip to content

Commit

Permalink
added condition to either connect to local db when server set to loca…
Browse files Browse the repository at this point in the history
…lhost
  • Loading branch information
ajibadeabd committed Jul 17, 2024
1 parent 908349c commit 69b20c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions helpers/ORMs/Mongoose/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ require("./schemas/users");
require("./schemas/oauthtokens");



const mongoServer = server == "localhost" ?

Check failure on line 11 in helpers/ORMs/Mongoose/index.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

helpers/ORMs/Mongoose/index.js#L11

You have a misspelled word: localhost on String
`mongodb://${server}:27017/${database}` :

Check failure on line 12 in helpers/ORMs/Mongoose/index.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

helpers/ORMs/Mongoose/index.js#L12

You have a misspelled word: mongodb on Template
`mongodb+srv://${username}:${password}@${server}/${database}`

class Database {
constructor() {
this.Mongoose = mongoose;
this._connect();

}
_connect() {
this.Mongoose.connect(
"mongodb://localhost:27017/salla-db"
// `mongodb+srv://${username}:${password}@${server}/${database}`
)
this.Mongoose.connect(mongoServer )
.then(() => {
console.log("Database connection successful");
})
Expand Down

0 comments on commit 69b20c3

Please sign in to comment.