owncast/webroot/js/config.js
2020-07-12 09:52:54 -07:00

16 lines
409 B
JavaScript

// add more to the promises later.
class Config {
async init() {
const configFileLocation = "/config";
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.
}
}
}