Fix database connection.
This commit is contained in:
@@ -3,10 +3,12 @@ const configuration = require('../configuration');
|
||||
const mongoConfig = configuration.mongodb;
|
||||
|
||||
function buildDatabaseUrl() {
|
||||
const username = mongoConfig.username;
|
||||
const username = encodeURIComponent(mongoConfig.username);
|
||||
const password = encodeURIComponent(mongoConfig.password);
|
||||
const url = `${mongoConfig.url}:${mongoConfig.port}`;
|
||||
const test = `mongodb://${username}:${password}@${url}`;
|
||||
const url = mongoConfig.url;
|
||||
const port = mongoConfig.port;
|
||||
const database = mongoConfig.database;
|
||||
const test = `mongodb://${username}:${password}@${url}:${port}/${database}`;
|
||||
console.log(test);
|
||||
return test;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ mongodb:
|
||||
url: 'localhost'
|
||||
port: 27017
|
||||
username: 'application_user'
|
||||
password: 'Password1'
|
||||
password: 'P@ssword1'
|
||||
database: 'db_application'
|
||||
security:
|
||||
jwt:
|
||||
|
||||
Reference in New Issue
Block a user