Update data/database.js
This commit is contained in:
+1
-2
@@ -1,12 +1,11 @@
|
||||
import { MongoClient } from 'mongodb';
|
||||
|
||||
const connectionProtocol = process.env.MONGODB_CONNECTION_PROTOCOL;
|
||||
const clusterAddress = process.env.MONGODB_CLUSTER_ADDRESS;
|
||||
const dbUser = process.env.MONGODB_USERNAME;
|
||||
const dbPassword = process.env.MONGODB_PASSWORD;
|
||||
const dbName = process.env.MONGODB_DB_NAME;
|
||||
|
||||
const uri = `${connectionProtocol}://${dbUser}:${dbPassword}@${clusterAddress}/?retryWrites=true&w=majority`;
|
||||
const uri = `mongodb+srv://${dbUser}:${dbPassword}@${clusterAddress}/?retryWrites=true&w=majority`;
|
||||
const client = new MongoClient(uri);
|
||||
|
||||
console.log('Trying to connect to db');
|
||||
|
||||
Reference in New Issue
Block a user