Refactoring (#2160)
This commit is contained in:
		
							parent
							
								
									c8c4ec6ad4
								
							
						
					
					
						commit
						4ee6d0b549
					
				
					 1 changed files with 1 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -3,9 +3,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 uri = u && p
 | 
			
		||||
	? `mongodb://${u}:${p}@${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`
 | 
			
		||||
	: `mongodb://${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
 | 
			
		||||
const uri = `mongodb://${u && p ? `${u}:${p}@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * monk
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue