You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							15 lines
						
					
					
						
							383 B
						
					
					
				
			
		
		
	
	
							15 lines
						
					
					
						
							383 B
						
					
					
				class Config { | 
						|
  async init() { | 
						|
    const configFileLocation = "./js/config.json"; | 
						|
     | 
						|
    try { | 
						|
      const response = await fetch(configFileLocation); | 
						|
      const configData = await response.json(); | 
						|
      Object.assign(this, configData); | 
						|
      return this; | 
						|
    } catch(error) { | 
						|
      console.log(error); | 
						|
      // No config file present.  That's ok.  It's not required. | 
						|
    } | 
						|
  } | 
						|
} |