Skip to content

Commit

Permalink
Removing default port for MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzapp committed Mar 3, 2021
1 parent d769b7b commit 1c9d305
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hashbrown-cms",
"repository": "https://github.com/HashBrownCMS/hashbrown-cms.git",
"version": "1.4.2",
"version": "1.4.3",
"description": "A free and open-source headless CMS",
"main": "hashbrown.js",
"scripts": {
Expand Down
11 changes: 6 additions & 5 deletions src/Server/Service/DatabaseService.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ class DatabaseService {
case 'host':
return 'localhost';

case 'port':
return '27017';

case 'prefix':
return 'hb_';

Expand Down Expand Up @@ -98,8 +95,12 @@ class DatabaseService {

hosts.forEach((host, index) => {
let port = ports[index] || ports[0];

connectionString += `${host}:${port}`;

if(port) {
connectionString += `${host}:${port}`;
} else {
connectionString += `${host}`;
}

if(index !== hosts.length - 1) {
connectionString += ',';
Expand Down

0 comments on commit 1c9d305

Please sign in to comment.