Added config class
This commit is contained in:
		
							
								
								
									
										15
									
								
								src/config.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/config.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					import { config as configDotenv } from 'dotenv';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					configDotenv();
 | 
				
			||||||
 | 
					export const config = {
 | 
				
			||||||
 | 
					    internal_port: parseInt(process.env.APP_PORT) || 4010,
 | 
				
			||||||
 | 
					    development: process.env.NODE_ENV === "production"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					let errors = 0
 | 
				
			||||||
 | 
					if (typeof config.internal_port !== "number") {
 | 
				
			||||||
 | 
					    errors++
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					if (typeof config.development !== "boolean") {
 | 
				
			||||||
 | 
					    errors++
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					export let e = errors
 | 
				
			||||||
		Reference in New Issue
	
	Block a user