Skip to content

Commit

Permalink
Update MongoDB URI
Browse files Browse the repository at this point in the history
  • Loading branch information
imda-benedictlee committed Apr 16, 2024
1 parent fb365c8 commit d0cd640
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion tests/graphql/project-template/08-queries.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import axios from 'axios';

const ENDPOINT = "http://127.0.0.1:3000/api/graphql"

let uri = "mongodb://mongodb:[email protected]:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1";
let environment = process.env.ENVIRONMENT_URL

let uri = ""

if(environment == "https://127.0.0.1")
uri = "mongodb://mongodb:[email protected]:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1";
else if(environment == "https://host.docker.internal")
uri = "mongodb://mongodb:[email protected]:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1";

const mongoClient = new MongoClient(uri)
const database = mongoClient.db('aiverify')
Expand Down
9 changes: 8 additions & 1 deletion tests/graphql/project-template/09-mutations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import axios from 'axios';

const ENDPOINT = "http://127.0.0.1:3000/api/graphql"

let uri = "mongodb://mongodb:[email protected]:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1";
let environment = process.env.ENVIRONMENT_URL

let uri = ""

if(environment == "https://127.0.0.1")
uri = "mongodb://mongodb:[email protected]:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1";
else if(environment == "https://host.docker.internal")
uri = "mongodb://mongodb:[email protected]:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1";

const mongoClient = new MongoClient(uri)
const database = mongoClient.db('aiverify')
Expand Down

0 comments on commit d0cd640

Please sign in to comment.