owncast/webroot/js/config.js

16 lines
426 B
JavaScript
Raw Normal View History

// add more to the promises later.
2020-06-15 01:18:43 +03:00
class Config {
async init() {
const configFileLocation = "https://goth.land/config";
2020-06-15 01:18:43 +03:00
try {
const response = await fetch(configFileLocation);
const configData = await response.json();
Object.assign(this, configData);
return this;
2020-06-15 01:18:43 +03:00
} catch(error) {
console.log(error);
// No config file present. That's ok. It's not required.
}
}
}