Check config on load (#4170)
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
This commit is contained in:
parent
41ba06a5e6
commit
96bc17aa10
19 changed files with 195 additions and 125 deletions
|
@ -1,7 +1,7 @@
|
|||
import config from '../config';
|
||||
|
||||
const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : null;
|
||||
const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null;
|
||||
const u = config.mongodb.user.map(x => encodeURIComponent(x)).getOrElse(null);
|
||||
const p = config.mongodb.pass.map(x => encodeURIComponent(x)).getOrElse(null);
|
||||
|
||||
const uri = `mongodb://${u && p ? `${u}:${p}@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue