mirror of
https://github.com/owncast/owncast.git
synced 2024-12-22 09:14:47 +03:00
19 lines
403 B
JavaScript
19 lines
403 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);
|
||
|
} catch(error) {
|
||
|
console.log(error);
|
||
|
// No config file present. That's ok. It's not required.
|
||
|
}
|
||
|
}
|
||
|
}
|