Skip to content

Commit 8340e97

Browse files
Kapnobatai3434NicolasRitouet
authored andcommitted
Chore: Removed generatePort() and used default MongoDB port (#22)
closes #20
1 parent 6453c70 commit 8340e97

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/cli/start.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const start = function (file) {
3131
let port = program.port,
3232
host = program.host || '127.0.0.1',
3333
dbname = program.dbname || '-deployd',
34-
mongoPort = generatePort(),
34+
mongoPort = program.mongoPort ? Number(program.mongoPort) : '27017',
3535
env = program.environment || process.env.DPD_ENV || 'development',
3636
retries = 0,
3737
credentials = {};
@@ -42,10 +42,6 @@ const start = function (file) {
4242
retries = env === 'development' && 5;
4343
}
4444

45-
if (program.mongoPort) {
46-
mongoPort = Number(program.mongoPort);
47-
}
48-
4945
if (file) {
5046
process.chdir(path.dirname(file));
5147
}
@@ -170,14 +166,6 @@ const start = function (file) {
170166
}
171167
};
172168

173-
/**
174-
* Port generation
175-
*/
176-
function generatePort() {
177-
const portRange = [3000, 9000];
178-
return Math.floor(Math.random() * (portRange[1] - portRange[0])) + portRange[0];
179-
}
180-
181169
function checkForUpdates() {
182170
http.get('http://registry.npmjs.org/deployd-cli', (err, res, body) => {
183171
if (!err) {

0 commit comments

Comments
 (0)