1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-12 13:48:28 +09:00

Refactoring (#2160)

This commit is contained in:
Aya Morisawa 2018-08-12 00:01:07 +09:00 committed by syuilo
parent c8c4ec6ad4
commit 4ee6d0b549

View File

@ -3,9 +3,7 @@ import config from '../config';
const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : null; const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : null;
const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null; const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null;
const uri = u && p const uri = `mongodb://${u && p ? `${u}:${p}@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
? `mongodb://${u}:${p}@${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`
: `mongodb://${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
/** /**
* monk * monk