This commit is contained in:
syuilo 2019-02-07 21:02:33 +09:00
parent 27768081e2
commit 5448c22031
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
19 changed files with 125 additions and 194 deletions

View file

@ -1,7 +1,7 @@
import config from '../config';
const u = config.mongodb.user.map(x => encodeURIComponent(x)).getOrElse(null);
const p = config.mongodb.pass.map(x => encodeURIComponent(x)).getOrElse(null);
const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : null;
const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null;
const uri = `mongodb://${u && p ? `${u}:${p}@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;