owncast/webroot/js/config.js

15 lines
383 B
JavaScript
Raw Normal View History

2020-06-15 01:18:43 +03:00
class Config {
async init() {
2020-06-16 01:45:55 +03:00
const configFileLocation = "./js/config.json";
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.
}
}
}