owncast/webroot/js/config.js
2020-06-14 15:18:43 -07:00

21 lines
No EOL
429 B
JavaScript

class Config {
constructor() {
this.init();
}
async init() {
const configFileLocation = "js/config.json";
try {
const response = await fetch(configFileLocation);
const configData = await response.json();
Object.assign(this, configData);
console.log(this);
} catch(error) {
console.log(error);
// No config file present. That's ok. It's not required.
}
}
}